VBA error inserting copied data - why?

KMack22

New Member
Joined
Jul 29, 2010
Messages
2
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?
 

Excel Facts

Format cells as date
Select range and press Ctrl+Shift+3 to format cells as date. (Shift 3 is the # sign which sort of looks like a small calendar).

KMack22

New Member
Joined
Jul 29, 2010
Messages
2
thanks Peter! I read what Microsoft had to say to fix. Ended up going another route though. I inserted the data rather than rows and it worked fine. not sure why, but happy it's fixed.

I hadn't thought to go to Microsoft and type in the exact error - I will do that next time. thanks!
 

Forum statistics

Threads
1,176,149
Messages
5,901,626
Members
434,907
Latest member
butterthemuffin

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top