title: Excel Macro. Searching between dates. Not working correctly?
body: <p>I'll start by stating the goal, then the steps I took, the problem and finally my question.</p>
  
  <p>Goal: 
  To search between two dates from jan 2017 till december 2017 in a table</p>
  
  <p><a href="https://i.stack.imgur.com/1wYa9.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/1wYa9.png" alt="Screenshot of the sheet"></a></p>
  
  <p>Steps: </p>
  
  <ul>
  <li>In the red triangled box, nr. 1, I type in the dates, the dates are in EU-format</li>
  <li>In this instance I search between 5 october 2017 and 6 november 2017</li>
  <li>I then press Search, a macro is assigned to it (I'll paste it bellow)</li>
  </ul>
  
  <p>Problem:</p>
  
  <ul>
  <li>In the red triangled box, nr. 2, you can see what comes up in the search</li>
  <li>In this instance the months may 2017 and june 2017 come up</li>
  <li>The reason, I suspect, is that my search term 5 october 2017, is seen as the 5th month, may, and 6 november, is seen as the 6th month, june</li>
  </ul>
  
  <p>Question:</p>
  
  <ul>
  <li>How do I get table/macro to show the results between 5 october 2017 and 6 november 2017, instead of the results between May 2017 and June 2017?</li>
  </ul>
  
  <p>Macro used for search button:</p>
  
  <pre><code>ActiveSheet.PivotTables("PivotTable2").PivotFields("Months").ClearAllFilters
  Application.CutCopyMode = False
  ActiveSheet.PivotTables("PivotTable2").PivotFields("Factuurdatum:"). _
      PivotFilters.Add2 Type:=xlDateBetween, Value1:=ActiveSheet.Range("E3").Value, Value2:=ActiveSheet.Range("F3").Value
  </code></pre>