MonthName Function [VBA]

The MonthName function returns the localized month name of a specified month number.

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:

MonthName(Month as Integer [,Abbreviate as Boolean])

Valor de retorn:

String

Paràmetres :

Month: Value from 1 to 12, January to December, whose localized month name need to be returned.

Abbreviate: Optional. A Boolean value that indicates if the month name is to be abbreviated.

Codis d'error

5 La crida al procediment no és vàlida

Exemple :

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

Option VBASupport 1

Sub Example_MonthName

 Dim mBirthday as Integer

 mBirthday = 1

 print mBirthday &" "& MonthName(mBirthday,False)

End Sub