You need to read this line again
Important: The macro examples use one function or two functions that you can find in the last section of this page.
As you forgot to add
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
End Function
or Instead of a function you can also check one row or column to find the last cell with a value.
Replace this line:
With:
Lr = DestSheet.Cells(Rows.Count, "A").End(xlUp).Row
VBA Noob
Bookmarks