Weekday function

Category: Date & Time

Summary

Day of week (1–7).

Syntax

Weekday(date, [ firstdayofweek ]) The Weekday function syntax has these named arguments:
Part
Description
dateRequired. Variant, numeric expression, string expression, or any combination, that can represent a date. If date contains Null, Null is returned.
firstdayofweekOptional. A constant that specifies the first day of the week. If not specified, vbSunday is assumed.

Example

Example
This example uses the Weekday function to obtain the day of the week from a specified date.
Dim MyDate, MyWeekDay
MyDate = #February 12, 1969# ' Assign a date.
MyWeekDay = Weekday(MyDate) ' MyWeekDay contains 4 because
' MyDate represents a Wednesday.

Microsoft Support Page

https://learn.microsoft.com/en-us/office/vba/language/reference/user-interface-help/weekday-function

Back to Functions