title: VBA For Loop - go longer than initially planned
body: <p>I would like to have an excel VBA For Loop that can go longer than I initially planned. For example:</p>
  
  <pre><code>Sub Test()
   LR = 10
  
   For i = 1 To LR
      Cells(i, 1).Value = 1
      If Cells(i, 2).Value &lt;&gt; "" Then
         LR = LR + 1
      End If
   Next i
  End Sub
  </code></pre>
  
  <p>Assuming there were contents in column 2/B, I am expecting to add 1 to LR at each iteration. I would expect this loop to continue to row 20. It is stopping on row 10 which is initially what is declared. How do I get around this issue, and have the loop go longer if I need to extend it based on a condition?</p>