Dim nLastCol As Long
Dim nLastRow As Long
With Cells.SpecialCells(xlCellTypeLastCell)
nLastRow = .Row
nLastCol = .Column
End With
or
Dim nLastCol As Long
Dim nLastRow As Long
With ActiveSheet.UsedRange
nLastRow = .Cells(.Count).Row
nLastCol = .Cells(.Count).Column
End With
come close.
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.