VBA WeekdayName Function

WeekdayName Description

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”.

WeekdayName Syntax

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)

Result: “Monday”

MsgBox WeekdayName(2, True)

Result: “Mon”

MsgBox WeekdayName(2, False, vbMonday)

Result: “Tuesday”

MsgBox WeekdayName(Weekday(Date))

Result: a string representing the day of the current system date.