Find Last used row in a Worksheet

by MD on 2010/01/10

Function FindLastRow()

Dim LastRow As Long

    If WorksheetFunction.CountA(Cells) > 0 Then

        'Search for any entry, by searching backwards by Rows.

        LastRow = Worksheets("data").Cells.Find(What:="*", After:=[A1], SearchOrder:=xlByRows, SearchDirection:=xlPrevious).Row

        FindLastRow = LastRow

    End If

End Function

You may also like:

Leave a Comment

Previous post:

Next post: