MonthName Function [VBA]

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

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:

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

Valor de retorno:

String

Parámetros:

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.

Códigos de erro

5 Chamada de procedemento incorrecta

Exemplo:

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

Option VBASupport 1

Sub Example_MonthName

 Dim mBirthday as Integer

 mBirthday = 1

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

End Sub