detriez
Board Regular
- Joined
- Sep 13, 2011
- Messages
- 193
- Office Version
- 365
- Platform
- Windows
I have multiple Subs that require finding the last row of my sheet
I use this over and over
I've added this module. How would I replace the above with this function?
I use this over and over
VBA Code:
Dim lr As Long
lr = ActiveSheet.Cells(Rows.Count, "B").End(xlUp).Row + 1
Application.ScreenUpdating = False
I've added this module. How would I replace the above with this function?
VBA Code:
Private Sub sLastRow()
Dim Last_Row As Long
On Error Resume Next
Last_Row = Cells.Find(What:="*", _
After:=Range("A1"), _
LookIn:=xlFormulas, _
LookAt:=xlPart, _
SearchOrder:=xlByRows, _
SearchDirection:=xlPrevious).Row
On Error GoTo 0
Debug.Print Last_Row
End Sub