In this Article
Returns a string representing the day of the week given a number from 1 to 7.
Simple WeekdayName Examples
Here is a simple WeekdayName example:
Sub WeekdayName_Example() MsgBox WeekdayName(3) End Sub
This code will return “Tuesday”.
In the VBA Editor, you can type “WeekdayName(” to see the syntax for the WeekdayName Function:
The Weekday function contains 3 arguments:
Weekday: A number representing the day of the week.
Abbreviate: [Optional] Boolean value that indicates if the weekday name is to be abbreviated. If omitted, the default is False, which means that the weekday name is not abbreviated.
FirstDayOfWeek: [Optional] Numeric value indicating which day of the week should be the first day.
Examples of Excel VBA WeekdayName Function
MsgBox WeekdayName(2, True)
MsgBox WeekdayName(2, False, vbMonday)
Result: a string representing the day of the current system date.
VBA Coding Made EasyStop searching for VBA code online. Learn more about AutoMacro - A VBA Code Builder that allows beginners to code procedures from scratch with minimal coding knowledge and with many time-saving features for all users!