FindLastRow

Setembro 23, 2008 at 3:02 pm (Excel)

Function FindLastRow(XPlanilha) As Variant
Dim LastRow As Variant

If XPlanilha.WorksheetFunction.CountA(XPlanilha.Cells) > 0 Then
LastRow = XPlanilha.Cells.Find(What:=”*”, SearchOrder:=xlByRows, SearchDirection:=xlPrevious).Row
End If

FindLastRow = LastRow
End Function

Comente