Mega Code Archive

 
Categories / VisualBasic Script / Excel
 

Get the last cell

Sub GetLastCell()    Dim RealLastRow As Long    Dim RealLastColumn As Long        Range("A1").Select    On Error Resume Next    RealLastRow = Cells.Find("*", Range("A1"), xlFormulas, , xlByRows, xlPrevious).Row    RealLastColumn = Cells.Find("*", Range("A1"), xlFormulas, , xlByColumns, xlPrevious).Column    Cells(RealLastRow, RealLastColumn).Select End Sub