I am trying to use Copy Destination as opposed to using Copy then ActiveSheet.Paste, as it should help the program run faster.
I have looked online and every example of Copy Destination uses explicitly defined ranges (for example: Sheet1.Range("A1:A200").Copy Destination:=Sheet2.Range("B1")
However, I am trying to use user-defined rows instead. I have an integer variable "UserRow", and an integer variable "LastRow", which finds the last row of a certain range. I have tried modifying the Copy Destination in the example, but I end up getting Run-time error '1004': Application-defined or object-defined error.
I don't know if I should be using a different way to select the ranges or there is something wrong with my syntax?
I have looked online and every example of Copy Destination uses explicitly defined ranges (for example: Sheet1.Range("A1:A200").Copy Destination:=Sheet2.Range("B1")
However, I am trying to use user-defined rows instead. I have an integer variable "UserRow", and an integer variable "LastRow", which finds the last row of a certain range. I have tried modifying the Copy Destination in the example, but I end up getting Run-time error '1004': Application-defined or object-defined error.
I don't know if I should be using a different way to select the ranges or there is something wrong with my syntax?
Code:
Dim LastRow As Integer
LastRow = Range("CompletedJobNum").Rows(Range("CompletedJobNum").Rows.Count).Row
Sheets("Current").Range(Cells(UserRow, 2), Cells(UserRow, 12)).Copy Destination:=Sheets("Current").Range(Cells(LastRow, 2))