Hi.
I have some code which runs by clicking a button in Sheet1.
I want the code to insert a new column in Sheet2 (using a variable 'colNo', which holds the column insert location as a number.)
I thought the following piece of code would do this okay:
. . . but it doesn't work.![]()
Dim colNo As Long colNo = 2 Sheets("Sheet2").Select Columns(colNo).Select Selection.Insert Shift:=xlToRight
I keep getting a '1004' error(?)
Does anyone know how to do this correctly?
Thanks in advance for your help.
Bookmarks