title: Filter between dates in Excel VBA
body: <p>I have a column in Excel VBA containing lots of dates of the format "dd.mm.yyyy hh:mm"
  I want to filter this column only between the Date (not by hours). Since it does not filter right using >= and &lt;= (i guess because of the times) i wanted to try to filter the following way:</p>
  
  <blockquote>
    <p>= StartDate and &lt; EndDate+1</p>
  </blockquote>
  
  <p>The StartDate &amp; EndDate is entered in a Textbox in the format mm/dd/yyyy by the user </p>
  
  <p>and the way i tried to filter is:</p>
  
  <pre><code> EndDate_1 = DateAdd("d", 1, EndDate)
   EndDate_1 = Format(EndDate_1, "mm/dd/yyyy")
  
   Selection.AutoFilter Field:=1, Criteria1:="&gt;=" &amp; StartDate, Operator:=xlAnd, Criteria2:="&lt;" &amp; EndDate_1
  </code></pre>
  
  <p>But this does not work (all the Data is filtered out, no error message)</p>
  
  <p>If I just enter </p>
  
  <pre><code>  Selection.AutoFilter Field:=1, Criteria1:="&gt;=" &amp; StartDate, Operator:=xlAnd, Criteria2:="&lt;=" &amp; EndDate
  </code></pre>
  
  <p>without any formatting on StartDate and EndDate the filtering works (not correctly but at least it works :))</p>
  
  <p>I tried so many thinks but I cant get it running!
  Thank you for helping!</p>