ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   How do i find the last cell range in a sheet (https://www.excelbanter.com/excel-programming/289733-how-do-i-find-last-cell-range-sheet.html)

Phil Hunt

How do i find the last cell range in a sheet
 
What is the VBA command to find the last cell range on a worksheet?

Thanks



Crash[_5_]

How do i find the last cell range in a sheet
 
Sub Last()

MsgBox "Last cell is " & _
ActiveSheet.UsedRange.SpecialCells(xlLastCell).Add ress
End Sub

Jon

Phil Hunt wrote:

What is the VBA command to find the last cell range on a worksheet?

Thanks





--
42°57N 81°16W



Phil Hunt

How do i find the last cell range in a sheet
 
That was quick. I may have more question later. This is my first time
programming Excel


"Crash" wrote in message
...
Sub Last()

MsgBox "Last cell is " & _
ActiveSheet.UsedRange.SpecialCells(xlLastCell).Add ress
End Sub

Jon

Phil Hunt wrote:

What is the VBA command to find the last cell range on a worksheet?

Thanks





--
42°57N 81°16W





Tom Ogilvy

How do i find the last cell range in a sheet
 
set rng = Cells.SpecialCells(xlCellTypeLastCell)

finds the lower right corner of the usedrange. It may not be what you
expect however.

--
Regards,
Tom Ogilvy

"Phil Hunt" wrote in message
...
What is the VBA command to find the last cell range on a worksheet?

Thanks





Phil Hunt

How do i find the last cell range in a sheet
 
Thanks guy. works great.


"Phil Hunt" wrote in message
...
What is the VBA command to find the last cell range on a worksheet?

Thanks






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

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