Excel VBA WeekdayName Function: The WeekdayName function in VBA returns a string containing the weekday name, for the specified integer representation of a weekday.

Syntax

Parameter

Weekday (required) – This parameter represents an integer between 1 and 7, representing the day of the week wherein the weekday that is represented by each integer value depends on the value of the [FirstDayOfWeek] parameter.

Abbreviate (optional) – This function represents a Boolean argument specifying whether the returned month name should be abbreviated or not. By default, it is set to False.

It can hold the following values:                                        

True – It returns the abbreviated week name, i.e. “Sun”, “Mon”, etc.

False (default value) – It returns the full week name i.e. “Sunday”, “Monday”, etc.

FirstDayOfWeek (optional) – This parameter specifies the weekday that should be used as the first day of the week. The default value is set to vbUseSystemDayOfWeek.

It can take the following values:

  • vbUseSystemDayOfWeek – The first day of the week is as specified in your system settings
  • vbSunday – Sunday
  • vbMonday – Monday
  • vbTuesday – Tuesday
  • vbWednesday – Wednesday
  • vbThursday – Thursday
  • vbFriday – Friday
  • vbSaturday – Saturday

Return

This function returns a string containing the weekday name for the specified integer representation of a weekday.

Example 1

Output

Monday

VBA WeekdayName Function

Example 2

Output

Mon

VBA WeekdayName Function

Example 3

Output

Tue

VBA WeekdayName Function

Example 4

Output

Tuesday

VBA WeekdayName Function

Pin It on Pinterest

Share This