Created
July 25, 2013 00:29
-
-
Save ijd65/6075837 to your computer and use it in GitHub Desktop.
Function to find the last row of a worksheet
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 characters
Function LastRow(sh As Worksheet) | |
On Error Resume Next | |
LastRow = sh.Cells.Find(What:="*", _ | |
After:=sh.Range("A1"), _ | |
Lookat:=xlPart, _ | |
LookIn:=xlFormulas, _ | |
SearchOrder:=xlByRows, _ | |
SearchDirection:=xlPrevious, _ | |
MatchCase:=False).Row | |
On Error GoTo 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment