LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 100
Default Exclude blank cells from a range?

Hi Friends,
I'm trying to select a group of cells in column C based on those in column A
which are not blank. I'm then going to put a formula in each of these cells
in column C.

My spreadsheet is as follows:

A B C D
1 Sym Quant Quant2
2 AMD 50
3 CSCO 200
4 DELL 150
5
6 IBM 70
7 HWP 300

In my VBA code, I want to put a formula in cells C2, C3, C4, C6, C7. That
is, all the cells in column C for which there is a symbol in column A. I
don't want to put a formula in C5 because there is no symbol in A5.

When I've done this based on a range with no blank cells, I've written
something similiar to the following:

'Create Range "Symbol"
Range("A1").Select
Cells.Find(What:="Sym").Range("A2").Select
Set FirstSymbol = Selection

Selection.Range("A5000").Select
Selection.End(xlUp).Select
Set LastSymbol = Selection
Range(FirstSymbol, LastSymbol).Select
Set Selection = Symbol

That creates the range in column A. I would then put in the code to select
a similar range as "Symbol" but in column C.

What I want to know is how I can select cells A2 through A7 but exclude A5.

Thanks,
Alan


--
achidsey
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Data Validation to exclude blank cells Simon Excel Discussion (Misc queries) 6 April 27th 10 03:33 PM
exclude blank cells in a line graph Whitehorn Charts and Charting in Excel 2 February 25th 09 08:53 PM
Maximum Number of Blank Cells between Non Blank Cells in a Range Mal Excel Worksheet Functions 5 November 3rd 07 08:21 AM
Need to exclude certain cells in a range Bob Smith Excel Worksheet Functions 3 May 5th 06 05:25 PM
How to use macros to copy a range of cells which can exclude some cells which I didn't want to be copied? excelnovice Excel Worksheet Functions 2 September 25th 05 12:38 AM


All times are GMT +1. The time now is 04:41 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"