title: How to change the range of cell in For … Each loop?
body: <p>I built a <code>For … Each</code> loop that finds the string and adds a column to the left.</p>
  <p>The problem is that I need to declare the range and I can't change it dynamically to the same range of the column of the string location.</p>
  <p>Here is the code:</p>
  <pre class="lang-vb prettyprint-override"><code>    Dim myRange As Range
      Dim myCell As Range
      Dim newcolumn As Range
  
      Set newcolumn = Range(&quot;A:A&quot;)
      Set myRange = Range(&quot;A1:cc1&quot;)
  
      For Each myCell In myRange
          If myCell = &quot;size&quot; Then
              newcolumn = myCell
              newcolumn.EntireColumn.Insert
          End If
      Next myCell
  End Sub
  </code></pre>
  <p>How can I add the column the the left of the <code>myCell</code> range?</p>