title: vba: get the week day number from a date?
body: <p>I would like to get the week day number from a date.</p>
  
  <p>E.g. :  if it is a Monday returns 1, if it is a Tuesday it returns 2, ... if it is a Sunday it returns 7.</p>
  
  <p>I was wondering if there is a direct function to obtain this, for instance:</p>
  
  <pre><code>DayNumber = Format(Date, &lt;format unknown to me&gt;)
  </code></pre>
  
  <p>The closest I could get is to use the function:</p>
  
  <pre><code>DayNumber = Format(Date, "dddd")
  </code></pre>
  
  <p>then loop through a predefined list of possible names, but I still wonder if there is a simpler way?</p>