title: Date Format not working in excel vba
body: <p>I'm having some difficulties with my datepicker date. StartDate and EndDate are values from DatePicker and Debug.Print will give me "mm/dd/yyyy". I am trying to change the date format to "dd/mmm/yyyy" so that I will be able to compare it with my data from MS access. But it's not working.</p>
  
  <pre><code>Sub cmdSubmit_Click()
      Dim StartDate As Date, EndDate As Date
  
      StartDate = DTPickStart.Value    ' 6/11/2018
      EndDate = DTPickEnd.Value        ' 6/24/2018
  
      StartDate = Format(StartDate, "dd/mmm/yyyy")
      EndDate = Format(EndDate, "dd/mmm/yyyy")
  
      Debug.Print StartDate           ' gave me 6/11/2018 instead of 11/Jun/2018
      Debug.Print EndDate
  End Sub
  </code></pre>
  
  <p>Any advice on what I am doing wrong here?</p>
  
  <p>Thanks in advance!</p>