title: change cell format within functions in excel VBA
body: <p>I wrote a function in excel vba. return value of the function is date, but function just return value of date in cell</p>
  
  <p>how can I change format of cell to date (short date is preferred) </p>
  
  <p>this is my code</p>
  
  <pre><code>Function ggg(rng As Range) As Date
  ggg = rng.value - 466699
  ggg = CDate(ggg)
  End Function
  </code></pre>