Macro shortcut insert column failure
Hi all, Hopefully this is a straightforward issue…. I have a macro which works fine when run via view macros but when the shortcut key is used to run it, the following line to insert a column always results in an error. is there something wrong with the code?
Thanks in advance!!!
Columns(“B:B”).Insert Shift:=xlToRight, CopyOrigin:=xlFormatFromLeftOrAbove
Shift key in the shortcut might be the problem.
Please have a look at the below solutions:
- Remove Shift key from your shortcut and choose another one
- Instead of using
.Open, you could use
.Addwhich will do the same job, but the code won’t hang. So if you do
Application.Workbooks.Add(yourPath)it should behave properly.
Add have the exact same behavior when you look at the screen while running the Macro.