title: VBA - Removing empty rows in - ActiveSheet.UsedRange.Rows.Count
body: <p>I have around 50 rows on my sheet and I am editing them using a VBA macro.<br>
  When I store the last used row in the following format  </p>
  
  <pre><code>NewLastRow = ActiveSheet.UsedRange.Rows.Count
  </code></pre>
  
  <p>NewLastRow came up with row 65, despite there being nothing in the rows.<br>
  So I incorporated a passage of code to select the active range, and delete rows which have no content. </p>
  
  <pre><code>ActiveSheet.UsedRange.Select
  
  'Deletes the row within the selection if the row has no data.
  Dim i As Long
  
  'Turn off aspects which could slow down process.
  With Application
      .Calculation = xlCalculationManual
      .ScreenUpdating = False
  
      'Delete backwards.
      For i = Selection.Rows.Count To 1 Step -1
          If WorksheetFunction.CountA(Selection.Rows(i)) = 0 Then
              Selection.Rows(i).EntireRow.Delete
          End If
      Next i
  
      .Calculation = xlCalculationAutomatic
      .ScreenUpdating = True
  End With
  </code></pre>
  
  <p>This works, however it takes a really long time. How can I speed it up?</p>