title: Excel Macro: Inserting a column and copying the formula into it from the adjacent column
body: <p>I am trying to insert a column into the sheet and copying the formulas into it from the adjacent column to the right. </p>
  
  <p>The place to insert the column is being read from the work sheet itself. E.G Column S (Column 19). </p>
  
  <p>So I need to insert a new Column at <code>Column</code> "S" and copy the formulas from the "Old" Column S, now Column T. </p>
  
  <p>I am using the following code but it is giving me 1004 error.</p>
  
  <pre><code> Sub Insert_Rows_Loop()
        Dim CurrentSheet As Object
        'MsgBox "ghj" &amp; 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
  </code></pre>