Excel VBA Find last used row in a column


Option Explicit

Sub sbTest()
 MsgBox fnGetLastRow(1, 2)
End Sub

Public Function fnGetLastRow(iRow As Long, iCol As Long) As Long
    Do Until ActiveSheet.Cells(iRow, iCol) = ""
        iRow = iRow + 1
    Loop
    fnGetLastRow = iRow - 1
End Function