I am trying to insert copied data from one wksht to another. I have written a macro and when I run it and I am getting error code 1004: cannot shift objects off sheet and don't know why.
Here is my code:
Range("A4").Select
Sheets("Data Entry").Range("A4:AG" & Sheets("Data Entry").Range("A4").End(xlDown).Row).Select
Selection.Copy
Sheets("Historical Data").Select
Rows("4:4").Select
(this line below is the one that stops and highlights the error):
Selection.Insert Shift:=xlDown
Application.CutCopyMode = False
does anyone know why it is doing that?
Here is my code:
Range("A4").Select
Sheets("Data Entry").Range("A4:AG" & Sheets("Data Entry").Range("A4").End(xlDown).Row).Select
Selection.Copy
Sheets("Historical Data").Select
Rows("4:4").Select
(this line below is the one that stops and highlights the error):
Selection.Insert Shift:=xlDown
Application.CutCopyMode = False
does anyone know why it is doing that?