How do i find the last cell range in a sheet

  • Thread starter Thread starter Phil Hunt
  • Start date Start date
P

Phil Hunt

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

Thanks
 
Sub Last()

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

Jon
 
That was quick. I may have more question later. This is my first time
programming Excel
 
set rng = Cells.SpecialCells(xlCellTypeLastCell)

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

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top