Weekday function
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.
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.
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.