title: Leading zero vba excel wrong dates
body: <p>I have this dates from DB and  I want to fix the date in VBA excel because excel switch the date with month when filter the column</p>
  
  <pre><code>27/08/2018
  31/08/2018
  12/9/2018
  2/8/2018    wrong date reported at filter in excel need 02/08/2018
  6/8/2018    wrong date reported at filter in excel need 06/08/2018
  13/08/2018
  17/08/2018
  20/08/2018
  20/08/2018
  </code></pre>
  
  <p>I have tried this </p>
  
  <pre><code>For i = 2 To lastRow
      Dim fDate As Date
      Dim dayF As String
      Dim monthF As String
      Dim yearF As String
  
  
      Set r = Cells(i, Column_DateStamp)
      strDate = Split(r.Text, "/")
  
      dayF = CStr(Format(strDate(0), "00"))
      monthF = CStr(Format(strDate(1), "00"))
      yearF = CStr(Format(strDate(2), "0000"))
      fDate = Format(DateSerial(strDate(2), CStr(Format(strDate(1), "00")), CStr(Format(strDate(0), "00"))), "dd/mm/yyyy")
      r.Clear
      r.Value = fDate
  Next i
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/UlOt7.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/UlOt7.png" alt="enter image description here"></a><a href="https://i.stack.imgur.com/HZb3I.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/HZb3I.png" alt="enter image description here"></a></p>