title: VBA Date format
body: <p>I need to filter a column that contain dates. I need to get all rows where the date is between the <code>current date</code> and the <code>current date + 15 days</code></p>
  
  <p>This is my VBA code to do that:</p>
  
  <pre><code>    Dim seuilDate As Date, currentDate As Date
      seuilDate = DateAdd("d", 15, Date)
      currentDate = Date
  
      MsgBox "Date seuil :" &amp; seuilDate &amp; "  Current Date:" &amp; currentDate
  
  
      With Workbooks("macro1.xlsm").Worksheets("Feuil1")
          If .FilterMode Then .ShowAllData
          '.range("C:C").AutoFilter Field:=3, Operator:=xlFilterValues
          .range("C:C").AutoFilter Field:=1, Criteria1:="&gt;=" &amp; currentDate, Criteria2:="&lt;" &amp; seuilDate, Operator:=xlAnd
      End With
  </code></pre>
  
  <p>this is what shows the MessageBox:</p>
  
  <p><a href="https://i.stack.imgur.com/BTS8Y.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/BTS8Y.png" alt="enter image description here"></a></p>
  
  <p>And this is what I want exactly, </p>
  
  <p>but in the excel file this what I get:</p>
  
  <p><a href="https://i.stack.imgur.com/WwYOp.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/WwYOp.png" alt="enter image description here"></a></p>
  
  <p>the day and the month fields are inversed in the <code>CurrentDate+15</code> variable.</p>
  
  <p>Any idea how to resolve this.</p>