J
Jeff Gross
I need to copy from one worksheet to the next blank row on another worksheet
but I keep getting an error on the below code at the line "Lr =
lastrow(DestSheet)". The error is a compile error (sub or function not
defined). Can anyone help?
Thanks ahead.
Sub copy_1()
Dim SourceRange As Range
Dim DestRange As Range
Dim DestSheet As Worksheet
Dim Lr As Long
With Application
.ScreenUpdating = False
.EnableEvents = False
End With
Set SourceRange = Sheets("Data Sort 1b").Range("A2300")
Set DestSheet = Sheets("Data Sort 1c")
Lr = lastrow(DestSheet)
Set DestRange = DestSheet.Range("A" & Lr + 1)
SourceRange.Copy DestRange
With Application
.ScreenUpdating = True
.EnableEvents = True
End With
End Sub
but I keep getting an error on the below code at the line "Lr =
lastrow(DestSheet)". The error is a compile error (sub or function not
defined). Can anyone help?
Thanks ahead.
Sub copy_1()
Dim SourceRange As Range
Dim DestRange As Range
Dim DestSheet As Worksheet
Dim Lr As Long
With Application
.ScreenUpdating = False
.EnableEvents = False
End With
Set SourceRange = Sheets("Data Sort 1b").Range("A2300")
Set DestSheet = Sheets("Data Sort 1c")
Lr = lastrow(DestSheet)
Set DestRange = DestSheet.Range("A" & Lr + 1)
SourceRange.Copy DestRange
With Application
.ScreenUpdating = True
.EnableEvents = True
End With
End Sub