title: VBA Excel: Insert a new column every nth column filled with a formula which refrences the immediate column to the left
body: <p>I would like to insert a new column every other column about 260 times, then I need to fill the new columns with a formula which references the immediate column to the left. Here is what I have to insert a new column: </p>
  
  <pre><code>Sub insert_column_every_other()
  For colx = 2 To 266 Step 2
  Columns(colx).Insert Shift:=xlToRight
  Next
  End Sub
  </code></pre>
  
  <p>But I am stuck on the formula, it merely copies the formula as is.. I need the C3 value to change and reference the immediate column to the left (other parts might not be 100% I am new to VBA so all corrections are appreciated):</p>
  
  <pre><code>Sub Repeat()
  For ColNum = 3 To 2000 Step 2
      Range(Cells(2, ColNum), Cells(21, ColNum)).FormulaR1C1 ="=AVERAGE(OFFSET(C3,1,0,2,1))"
  Next ColNum
  End Sub
  </code></pre>