ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Last Cell on a Worksheet (https://www.excelbanter.com/excel-programming/371134-last-cell-worksheet.html)

DavidW[_12_]

Last Cell on a Worksheet
 

I would like to get the last cell used on a worksheet and place it in
variable. I would like for the last cell address to be in the forma
with a letter as column and an integer as row. For example: if the las
row is L257, I would like it to be stored in the variable as L257 rathe
than as an integer. I know how to find the last cell and display it in
message box after finding integer values of the last row and column. Th
following will display the last cell as $L$257:

MsgBox Cells(LastRow, LastColumn).Address

Can I place that value in a cell as L257? Or can someone point me t
some code that will get the last cell in that format?

Thanks. I know this is easy

--
David
-----------------------------------------------------------------------
DavidW's Profile: http://www.excelforum.com/member.php...fo&userid=3263
View this thread: http://www.excelforum.com/showthread.php?threadid=57422


Bob Phillips

Last Cell on a Worksheet
 
MsgBox Cells(LastRow, LastColumn).Address(False,False)

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"DavidW" wrote in
message ...

I would like to get the last cell used on a worksheet and place it in a
variable. I would like for the last cell address to be in the format
with a letter as column and an integer as row. For example: if the last
row is L257, I would like it to be stored in the variable as L257 rather
than as an integer. I know how to find the last cell and display it in a
message box after finding integer values of the last row and column. The
following will display the last cell as $L$257:

MsgBox Cells(LastRow, LastColumn).Address

Can I place that value in a cell as L257? Or can someone point me to
some code that will get the last cell in that format?

Thanks. I know this is easy.


--
DavidW
------------------------------------------------------------------------
DavidW's Profile:

http://www.excelforum.com/member.php...o&userid=32630
View this thread: http://www.excelforum.com/showthread...hreadid=574222





All times are GMT +1. The time now is 08:16 PM.

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