ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   How to Retrieve Last Used Cell In Column (https://www.excelbanter.com/excel-programming/280956-how-retrieve-last-used-cell-column.html)

Marshall

How to Retrieve Last Used Cell In Column
 
I'm having trouble figuring out how to do this. Could someone help me
out.


All of the cells before the last used cell may or may not be filled
with something. In the end I'm going to need the row number of this
cell as well.


Any help is greatly appreciated!

Thanks :)



------------------------------------------------
~~ Message posted from http://www.ExcelTip.com/
~~ View and post usenet messages directly from http://www.ExcelForum.com/


Ron de Bruin

How to Retrieve Last Used Cell In Column
 
Hi Marshall

Sub LastCellInColumnA()
Range("A" & Rows.Count).End(xlUp).Select
End Sub

this will give you the row
Range("A" & Rows.Count).End(xlUp).row


--
Regards Ron de Bruin
(Win XP Pro SP-1 XL2002 SP-2)
www.rondebruin.nl



"Marshall" wrote in message ...
I'm having trouble figuring out how to do this. Could someone help me
out.


All of the cells before the last used cell may or may not be filled
with something. In the end I'm going to need the row number of this
cell as well.


Any help is greatly appreciated!

Thanks :)



------------------------------------------------
~~ Message posted from http://www.ExcelTip.com/
~~ View and post usenet messages directly from http://www.ExcelForum.com/




steve

How to Retrieve Last Used Cell In Column
 
Marshall,

Dim lrow as Long
lrow = Cells(Rows.COUNT, "A").End(xlUp).Row

This finds the last used cell in column A, regardless of any blank cells.
Change "A" to any column you want.
--
sb
"Marshall" wrote in message
...
I'm having trouble figuring out how to do this. Could someone help me
out.


All of the cells before the last used cell may or may not be filled
with something. In the end I'm going to need the row number of this
cell as well.


Any help is greatly appreciated!

Thanks :)



------------------------------------------------
~~ Message posted from http://www.ExcelTip.com/
~~ View and post usenet messages directly from http://www.ExcelForum.com/





All times are GMT +1. The time now is 02:18 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com