I am trying to insert a column into the sheet and copying the formulas into it from the adjacent column to the right.
The place to insert the column is being read from the work sheet itself. E.G Column S (Column 19).
So I need to insert a new Column at Column
"S" and copy the formulas from the "Old" Column S, now Column T.
I am using the following code but it is giving me 1004 error.
Sub Insert_Rows_Loop()
Dim CurrentSheet As Object
'MsgBox "ghj" & Sheet16.Range("H2").Value
Sheet2.Cells(1, Sheet16.Range("H2").Value).EntireColumn.Select
Selection.Copy
Selection.Insert Shift:=xlToLeft
Application.CutCopyMode = False
Sheet2.Cells(1, Sheet16.Range("G2").Value).EntireColumn.Select
Selection.Copy
Selection.Insert Shift:=xlToLeft
Application.CutCopyMode = False
Sheet2.Cells(1, Sheet16.Range("F2").Value).EntireColumn.Select
Selection.Copy
Selection.Insert Shift:=xlToLeft
Application.CutCopyMode = False
End Sub