title: Delete blank rows until LastRow variable
body: <p>I am trying to delete all blank rows until the <code>LastRow</code> variable. Below you'll find my samples. The one that works <strong>seems a serious workaround and I believe it could be shorter/quicker</strong>, I just don't have the knowledge on how to do it.</p>
  
  <p><strong>Works - Serious workaround</strong></p>
  
  <pre><code>LastRow = Cells(Rows.Count, "A").End(xlUp).Row
  
  For i = 1 to LastRow
     If Range("A" &amp; i).value = "" then
        Range("A" &amp; i).value = "xxxxx"
     End if
  Next i
  
  For i = 1 to LastRow
     If Range("A" &amp; i).value = "xxxxx" then
        Range("A" &amp; i).Delete
        i = i - 1
     End if
  Next i
  </code></pre>
  
  <p><strong>Infinite loop</strong></p>
  
  <pre><code>LastRow = Cells(Rows.Count, "A").End(xlUp).Row
  
  For i = 1 to LastRow
     If Range("A" &amp; i).value = "" then
        Range("A" &amp; i).Delete
        i = i - 1
     End if
  Next i
  </code></pre>