WeekdayName Function [VBA]

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

Icona Aviso

Esta función ou constante actívase coa instrución Option VBASupport 1 colocada antes do código de programa executábel dun módulo.


Sintaxe:

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

Valor de retorno:

String

Par√°metros:

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

Value

Description

vbUseSystemDayOfWeek

0

Use National Language Support (NLS) API setting

vbSun­day

1

Sun­day (default)

vbMonday

2

Monday

vbTuesday

3

Tuesday

vbWednesday

4

Wednesday

vbThursday

5

Thursday

vbFriday

6

Friday

vbSaturday

7

Saturday


Códigos de erro

None

Exemplo:

REM  *****  BASIC  *****

Option VBASupport 1

Sub Example_WeekdayName

 Dim tgf as Integer

 tgf = 6

 print tdf &" "& WeekdayName(tgf,False,vbSunday)

End Sub