title: Excel VBA - the date format changes automatically
body: <p>I'm trying to enter the Date value by adding a month to the date in Sheets("Sheet1").Cells(17, 3).Value which is 01/10/2011 but format as Oct-11. Then return in Sheets("Sheet1").Cells(17, 4).Value = LDate, to show Nov-11</p>
  
  <pre><code>sDate = Sheets("Sheet1").Cells(17, 3).Value   --&gt; this shows 01/10/2011 when I hove over sDate
  LDate = DateAdd("m", 1, sDate)                --&gt; this shows 01/11/2011 when I hove over LDate
  </code></pre>
  
  <p>I then want to enter that value 01/11/2011 in to the following cell</p>
  
  <pre><code>Sheets("Sheet1").Cells(17, 4).Value = LDate
  Selection.NumberFormat = "mmm-yy"
  </code></pre>
  
  <p>But in the cell it shows  11/01/2011 (Jan-11), why is it doing this and how can I fix this issue?</p>