WeekdayName Function [VBA]

The WeekdayName function returns the weekday name of a specified day of the week.

warning

This constant, function or object is enabled with the statement Option VBASupport 1 placed before the executable program code in a module.


Syntax:


        WeekdayName(Weekday as Integer [,Abbreviate as Boolean [,FirstDayofWeek as Integer]])
    

Return value:

String

Parameters:

Weekday: Value from 1 to 7, Mon­day to Sun­day, whose Week Day Name need to be calculated.

Abbreviate: Optional. A Boolean value that indicates if the weekday name is to be abbreviated.

FirstDayofWeek: Optional. Specifies the first day of the week.

First day of Week:

Named constant

āĻŽāĻžāĻ¨

āĻŦāĻŋāĻŦāĻ°āĻŖ

vbUseSystemDayOfWeek

0

Use National Language Support (NLS) API setting

vbSun­day

1

Sun­day (default)

vbMonday

2

āĻ¸ā§‹āĻŽāĻŦāĻžāĻ°

vbTuesday

3

āĻŽāĻ™ā§āĻ—āĻ˛āĻŦāĻžāĻ°

vbWednesday

4

āĻŦā§āĻ§āĻŦāĻžāĻ°

vbThursday

5

āĻŦā§ƒāĻšāĻ¸ā§āĻĒāĻ¤āĻŋāĻŦāĻžāĻ°

vbFriday

6

āĻļā§āĻ•ā§āĻ°āĻŦāĻžāĻ°

vbSaturday

7

āĻļāĻ¨āĻŋāĻŦāĻžāĻ°


Error codes:

āĻāĻ•āĻŸāĻŋāĻ“ āĻ¨āĻž

Example:


        REM  *****  BASIC  *****
        Option VBASupport 1
        Sub Example_WeekdayName
         Dim tgf as Integer
         tgf = 6
         print tgf &" "& WeekdayName(tgf,False,vbSunday)
        End Sub
    

Please support us!