FIND method to determine Last Row with Data, in a worksheet


Sub LastUsedRow_Find()

Dim lastRow As Long
Dim rng As Range

Set rng = ActiveSheet.Cells

lastRow = rng.Find(What:="*" , After:=rng.Cells(1), Lookat:=xlPart, LookIn:=xlFormulas, SearchOrder:=xlByRows, SearchDirection:=xlPrevious, MatchCase:=False).Row

MsgBox lastRow

End Sub

Comments

Popular posts from this blog

50 Excel VBA Oral Interview Questions