WEEKDAYNAME(weekday [,abbreviate] [,firstdayofweek])

Returns the day of the week as a string (String).

weekdayThe numeric designation for the day of the week (Integer).
abbreviate(Optional) Whether the week day name is abbrevated (Boolean):
False = the week day name is not abbreviated (default)
True = the week day name is abbreviated
firstdayofweek(Optional) A vbDayOfWeek constant that specifies the first week of the year (Integer):
0 = vbUseSystem
1 = vbSunday (default)
2 = vbMonday
3 = vbTuesday
4 = vbWednesday
5 = vbThursday
6 = vbFriday
7 = vbSaturday

* If "abbreviate" = True then the weekday name will be abbreviated to three characters.
* If "abbreviate" = False then the weekday name will not be abbreviated.
* If "abbreviate" is left blank, then False is used.
* If "firstdayofweek" is left blank, then 1 is used.
* Numeric value of each day depends on setting of the firstdayofweek setting
* You can use the MONTHNAME function to return the day of the month as a string.
* This function was added in Office 2000.
* The equivalent .NET function is Microsoft.VisualBasic.DateAndTime.WeekdayName
* For the Microsoft documentation refer to docs.microsoft.com

Debug.Print WeekdayName(1) = Monday 
Debug.Print WeekdayName(1, False) = Monday
Debug.Print WeekdayName(1, True) = Mon
Debug.Print WeekdayName(1, , vbUseSystemDayOfWeek) = Monday
Debug.Print WeekdayName(1, , vbMonday) = Monday
Debug.Print WeekdayName(1, , vbSunday) = Sunday
Debug.Print WeekdayName(2) = Tuesday
Debug.Print WeekdayName(2, True) = Tue
Debug.Print WeekdayName(2, True, vbMonday) = Tue
Debug.Print WeekdayName(2, True, vbTuesday) = Wed
Debug.Print WeekdayName(2, True, vbWednesday) = Thu

© 2020 Better Solutions Limited. All Rights Reserved. © 2020 Better Solutions Limited Top