Hello,
I have a macro that is suppose to copy cells with data from one worksheet and paste them to another except when I run the Macro I get the Macro Error 1004. Here is my code below:
The Macro stops on this particular line of code:
I have a macro that is suppose to copy cells with data from one worksheet and paste them to another except when I run the Macro I get the Macro Error 1004. Here is my code below:
Code:
Sub UpdateReport()
Dim lngFirstRowToAdd As Long, lngLastRowToAdd As Long, lngLastReportRow As Long, lngLastColumnToAdd As Long
lngFirstRowToAdd = Sheets("rptNoTune").Range("A65536").End(xlUp).End(xlUp).Offset(1, 0).Row
lngLastRowToAdd = Sheets("rptNoTune").Range("A65536").End(xlUp).Row
lngLastColumnToAdd = Sheets("rptNoTune").Range("A10").End(xlToRight).Column
lngLastReportRow = Sheets("rptTune").Range("A65536").End(xlUp).Offset(1, 0).Row
Sheets("rptNoTune").Range(Cells(lngFirstRowToAdd, 1), Cells(lngLastRowToAdd, lngLastColumnToAdd)).Copy
Sheets("rptTune").Range("A" & lngLastReportRow).PasteSpecial
Application.CutCopyMode = False
End Sub
The Macro stops on this particular line of code:
Code:
Sheets("rptNoTune").Range(Cells(lngFirstRowToAdd, 1), Cells(lngLastRowToAdd, lngLastColumnToAdd)).Copy