Macro help

  • Thread starter Thread starter jschping
  • Start date Start date
J

jschping

Hi,

I created a macro for automating the input of a delimited text file. Once
all the stuff is imported, I want to reformat some of the data. I have the
formula ready, but have no clue how to make it apply to the whole column if I
don't know ahead of time how many rows the column will contain. I can
manually put it in the top cell and drag it down, but I want it to be part of
the macro. How do I do this?

Thanks!
 
Hi,

It would have helped to see the formula and where it is to go but this is
one way

lastrow = Sheets("Sheet1").Cells(Cells.Rows.Count, "A").End(xlUp).Row
Range("B1").Formula = "=A1"
Range("B1:B" & lastrow).FillDown

Mike
 
It worked! Thanks so much.

Mike H said:
Hi,

It would have helped to see the formula and where it is to go but this is
one way

lastrow = Sheets("Sheet1").Cells(Cells.Rows.Count, "A").End(xlUp).Row
Range("B1").Formula = "=A1"
Range("B1:B" & lastrow).FillDown

Mike
 
Back
Top