View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Joe Joe is offline
external usenet poster
 
Posts: 476
Default fill a variable sized range

I am using a macro to extract records from a database into columns AC:AF.
The number of records change based on criteria selection. I then need to add
another value (Defined Range Name) to each row in AB. The value will be the
same and is stored elsewhere in the worksheet. If AC:AF has 5 rows I only
want to put the AB value on those same 5 rows, if AC:AF has 10 rows I want to
add it to those 10 rows. So how to I control the macro to add the value in
AB for just those rows with a value in AC.

I hope that helps

"Rick Rothstein" wrote:

Your question is not clear to me. Initially you say you want to add a value
(singular) from a named cell (do you mean a cell with a Defined Name, or do
you just mean you want to specify the cell address?) but then you go on to
say you want to add values (plural) in AB that have data in AC... is there
any linkage between what you want to put in AB and what is in AC, or do you
just want to put the value(s?) in the first blank cell in AB where AC next
to it is not blank? I guess my main problem is I can't visualize your setup
from your description.

--
Rick (MVP - Excel)


"Joe" wrote in message
...
I have data elements in cols AC:AF. Data will be in rows from 5 to
whatever.
I need to add a value from another named cell in the worksheet into col
AB.
How do I do it so I only add values in AB that have data in AC?


.