Contingut
Índex 🔎︎

# Funció WeekdayName [VBA]

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

This function or constant is enabled with the statement Option VBASupport 1 placed before the executable program code in a module.

### Sintaxi:

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

### Valor de retorn:

String

### Paràmetres:

Weekday: Value from 1 to 7, Monday to Sunday, 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
vbSunday | 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

Temes relacionats

Funcions d'hora i data del VBA