Funció WeekdayName [VBA]

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

warning

Aquesta funció o constant s'activa amb l'expressió Option VBASupport 1 plaçada en un mòdul abans del codi executable.


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
    

Ens cal la vostra ajuda!