title: Excel: Use VBA to delete rows within a specified date range
body: <p>I have a workbook with ~20 sheets. In each sheet Column A has dates and Column B has data points. Column A is not the same in every sheet! I want to cut out data I don't need based on date ranges. I've tried this, and it runs for quite a long time, but does nothing.</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>Sub DeleteRowBasedOnDateRange()
  
  Dim RowToTest As Long
  Dim ws As Worksheet
  
  For Each ws In ThisWorkbook.Sheets
  
  For RowToTest = ws.Cells(Rows.Count, 1).End(xlUp).Row To 2 Step -1
  
  With ws.Cells(RowToTest, 1)
      If .Value &gt; #6/16/2015# _
      And .Value &lt; #6/22/2015# _
      Then _
      ws.Rows(RowToTest).EntireRow.Delete
  End With
  
  Next RowToTest
  
  Next
  
  End Sub</code></pre>
  </div>
  </div>
  </p>
  
  <p>Suggestions?</p>