View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default macro to copy a function down a list

Dim rng as Range
set rng = Activesheet.UsedRange.Columns(1).cells
Range("A2:A" & rng(rng.count).row).Formula = Range("A2").Formula

--
Regards,
Tom Ogilvy

"steven" wrote in message
...
Hi,

this should be fairly easy. I'd like a macro that copies a function (any
function for example a vlookup() function) down in a list. So lets say I
have
a list of data and I insert a column (column A), then i put a function (or
anything for that mater) in cell A2 and I want it copied down to lets say
cell A2000.

I want this function to work in any list though no matter how many rows it
has. It has to somehow "see" the where the data rows end in the cells next
to
column A, and just copy up to there.

Also column B and C might also be blank and the list might start from
column
D for example.

Hope that makes sence. Thank you

Steven.