A family of Microsoft spreadsheet software with tools for analyzing, charting, and communicating data.
"Selection.Insert Shift:=xlToRight" causing problem with Macro
I have a selection of data that I'm trying to insert in my spreadsheet via a Macro. The strange thing is that if I run the macro first thing when I open the file, it works fine. But if any changes are made to the file, then if I run it I get an error. The line it is getting stuck at is "Selection.Insert Shift:=xlToRight". I can't figure out why that is causing a problem! Any help would be appreciated! Here is part of the code for macro:
Sheets("Program Plans").Select
Columns("C:I").Select
Selection.Copy
Range("C1").Select
Selection.Insert Shift:=xlToRight
Thank you in advance!
Microsoft 365 and Office | Excel | For home | Windows
Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.