9QEDP‖MonthName Function [VBA]

Contents
A5j2S‖

# awMU4‖MonthName Function [VBA]

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

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

### FVEx2‖Syntax:

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

### bBBqF‖Return type:

String

### WADQ4‖Parameters:

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

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

### SEjHR‖Error codes:

5 Invalid procedure call

### EFSA4‖Example:

            REM  *****  BASIC  *****
            Option VBASupport 1
            Sub Example_MonthName
             Dim mBirthday as Integer
             mBirthday = 1
             print mBirthday &" "& MonthName(mBirthday,False)
            End Sub

Related Topics

VBA Time and Date functions

Please support us!