![]() |
Using last row in macros
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. |
Using last row in macros
Number = ActiveSheet.UsedRange.SpecialCells(xlLastCell).Row
"robertlewis" wrote: 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. |
Using last row in macros
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 -- Don Guillett SalesAid Software "robertlewis" wrote in message ... 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. |
All times are GMT +1. The time now is 04:42 AM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com