title: excel date format not same as in vba
body: <p>I found an issue for date format in excel, which the display format is not as same as the <code>numberformat</code> in vba
  and I have create a test for this case.</p>
  
  <p><code>Regional Setting for Short Date: MM/dd/yyyy</code></p>
  
  <p>modules:</p>
  
  <pre><code>Function RetrieveNumberFormat() As String
      Dim rng As Range
      Set rng = Application.Caller    
      RetrieveNumberFormat = rng.NumberFormat       
      Set rng = Nothing
  End Function
  
  Function SetDate() As String
      Dim rng As Range    
      Set rng = Application.Caller    
      SetDate = Format(Now, rng.NumberFormat)    
      Set rng = Nothing
  End Function
  </code></pre>
  
  <p>In Excel</p>
  
  <pre><code>Col A (Date w default format) | Col B (MM/dd/yyyy)      | Col C (dd-mmm-yyyy)     | Col D (dd/mm/yyyy)      | Col E ([$-404]mm/dd/yyyy)
  =Now()                        | =Now()                  | =Now()                  | =Now()                  | =Now()
  =RetrieveNumberFormat()       | =RetrieveNumberFormat() | =RetrieveNumberFormat() | =RetrieveNumberFormat() | =RetrieveNumberFormat()
  =SetDate()                    | =SetDate()              | =SetDate()              | =SetDate()              | =SetDate()
  </code></pre>
  
  <p>Date with default format (Col A):</p>
  
  <p><img src="https://i.stack.imgur.com/Gg7pJ.png" alt="Date format"></p>
  
  <p>Result:</p>
  
  <p><img src="https://i.stack.imgur.com/UCsmE.png" alt="Result"></p>
  
  <p>May I know why Excel changed <code>System Date Format MM/dd/yyyy</code> to <code>m/d/yyyy</code>, and is there a way to workaround? </p>