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!