Syntax
Weekday(SerialNumber)
Remarks
Returns an integer between 1 and 7, inclusive, corresponding to the day of the week (where 1 is Sunday) on which the date represented by SerialNumber falls.
A serial number is a decimal representation of the date, time, or both. For information about serial numbers, see DateSerial().
Example
This example defines an array containing the names of the days of the week, returns a number corresponding to the current weekday, and then uses this number with the array to return the name of the current weekday. This name is then displayed in a message box.
Dim days$(7) days$(1) = "Sunday" : days$(2) = "Monday" : days$(3) = "Tuesday" days$(4) = "Wednesday" : days$(5) = "Thursday" days$(6) = "Friday" : days$(7) = "Saturday" thisday = Weekday(Now()) MsgBox "Would you believe it's " + days$(thisday) + " already?"
See Also
DateSerial(), Day(), Hour(), Minute(), Month(), Now(), Second(), Today(), Year()