Created
May 15, 2013 04:03
-
-
Save stevehenderson/5581580 to your computer and use it in GitHub Desktop.
A VBA helper function to find the final row of data on a worksheet (VBA, row, last, find)
This file contains 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 characters
'findFinalRow | |
'A helper function to find the final row of data on a worksheet | |
' | |
'To use, provide the name of the worksheet | |
'The function assumes the data starts in cell A1 | |
'and will return the row number of the last row of data | |
' | |
'Author: Steve Henderson [email protected] | |
' | |
Function findFinalRow(sheetName As String) | |
'Set the Worksheet Name | |
Set WS = Worksheets(sheetName) | |
' Find the last row with data | |
findFinalRow = WS.Cells(Application.Rows.Count, 1).End(xlUp).row | |
End Function |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment