Created
July 27, 2011 13:41
Revisions
-
Benjamin Hoffstein created this gist
Jul 27, 2011 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,8 @@ Function FindLastRow(Optional sheetToSearch As Worksheet) As Long If sheetToSearch Is Nothing Then Set sheetToSearch = ActiveSheet On Error GoTo handler FindLastRow = sheetToSearch.Cells.Find("*", SearchOrder:=xlByRows, SearchDirection:=xlPrevious).Row Exit Function handler: FindLastRow = 1 ' No data on sheet End Function