Funció WeekdayName [VBA]

La funció WeekdayName retorna el nom corresponent al dia de la setmana que especifiqueu.

Icona d'avís

Aquesta funció o constant s'activa amb l'expressió Opció VBASupport 1 situada abans del codi de programació executable en un mòdul.


Sintaxi:

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

Valor de retorn:

String

Paràmetres:

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.

Primer dia de la setmana:

Constant amb nom

Valor

Descripció

vbUseSystemDayOfWeek

0

Use National Language Support (NLS) API setting

vbSun­day

1

Diumenge (per defecte)

vbMonday

2

Dilluns

vbTuesday

3

Dimarts

vbWednesday

4

Dimecres

vbThursday

5

Dijous

vbFriday

6

Divendres

vbSaturday

7

Dissabte


Codis d'error

Cap

Exemple:

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

Option VBASupport 1

Sub Example_WeekdayName

 Dim tgf as Integer

 tgf = 6

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

End Sub