Mega Code Archive

 
Categories / VisualBasic Script / Excel
 

Get the last row and last cell

Sub LastCell()   Dim rngLast As Range   Dim LastRow As Long, LastCol As Long      Set rngLast = Range("A1").SpecialCells(xlCellTypeLastCell)   LastRow = rngLast.Row   LastCol = rngLast.Column   MsgBox LastRow & " " & LastCol End Sub