title: Move column without changing the reference
body: <p>I have an Excel sheet were you paste data into from another program. There are twenty or so columns and I want to find and move eight of them all the way to the left but when doing so the references to them changes. Even if I add dollar signs.</p>
  <p>This is the code that moves them:</p>
  <pre><code>For i = 1 To lastColumn
      If S.Cells(1, i) = &quot;Status&quot; Then
          S.Columns(i).Cut
          S.Columns(1).Insert
          Exit For
      End If
  Next i
  
  For i = 1 To lastColumn
      If S.Cells(1, i) = &quot;Order&quot; Then
          S.Columns(i).Cut
          S.Columns(2).Insert
          Exit For
      End If
  Next i
  
  For i = 1 To lastColumn
      If S.Cells(1, i) = &quot;Delivery&quot; Then
          S.Columns(i).Cut
          S.Columns(3).Insert
          Exit For
      End If
  Next i
  
  For i = 1 To lastColumn
      If S.Cells(1, i) = &quot;Deliverymethod&quot; Then
          S.Columns(i).Cut
          S.Columns(4).Insert
          Exit For
      End If
  Next i
  
  For i = 1 To lastColumn
      If S.Cells(1, i) = &quot;Deliverypriority&quot; Then
          S.Columns(i).Cut
          S.Columns(5).Insert
          Exit For
      End If
  Next i
  
  For i = 1 To lastColumn
      If S.Cells(1, i) = &quot;Usertype&quot; Then
          S.Columns(i).Cut
          S.Columns(6).Insert
          Exit For
      End If
  Next i
  
  For i = 1 To lastColumn
      If S.Cells(1, i) = &quot;Article&quot; Then
          S.Columns(i).Cut
          S.Columns(7).Insert
          Exit For
      End If
  Next i
  
  For i = 1 To lastColumn
      If S.Cells(1, i) = &quot;Shelf&quot; Then
          S.Columns(i).Cut
          S.Columns(8).Insert
          Exit For
      End If
  Next i
  </code></pre>
  <p>In another sheet I have several formulas referencing to these columns. Example:
  <code>=COUNTIF(S!$H:$H;&quot;*&quot;)-1</code></p>
  <p>When I run my code, the columns moves to where they should but the formula changes to
  <code>=COUNTIF(S!$I:$I;&quot;*&quot;)-1</code></p>
  <p>Is there a way to move the columns without changing the reference?</p>