Using last row in macros

R

robertlewis

I want to be able to select the last row which contains data and use the row
number in a macro to select all the cells in a column from the top to the
last row. The number of rows varies each time the macro is run.
 
D

Don Guillett

lr=cells(rows.count,"a").end(xlup).row
range(cells(1,"a"),cells(lr,"a")).copy range("b3")

You rarely need to select but if you insist
lr=cells(rows.count,"a").end(xlup).row
range(cells(1,"a"),cells(lr,"a")).select
 
Top