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!