MonthName Function [VBA]

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

Ikon Peringatan

Fungsi atau konstanta ini diaktifkan dengan pernyataan Option VBASupport 1 yang ditempatkan sebelum kode program yang dapat dieksekusi dalam sebuah modul.


Sintaksis:

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

Nilai balikan:

String

Parameter:

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.

Kode kesalahan:

5 Tidak sah dalam pemanggilan prosedur

Contoh:

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

Option VBASupport 1

Sub Example_MonthName

 Dim mBirthday as Integer

 mBirthday = 1

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

End Sub