Funzione MonthName

Restituisce una stringa che indica il mese specificato.

Sintassi

MonthName(month[,abbreviate])

Argomenti:

  • Month: obbligatorio. Designazione numerica del mese. Ad esempio, gennaio 1, febbraio 2 e così via
  • Abbreviate: facoltativo. Valore booleano che indica se il nome del mese deve essere abbreviato. Se omesso, l'impostazione predefinita è False, ovvero il nome del mese non viene abbreviato.

Note

Nell'esempio seguente viene utilizzata la funzione MonthName per restituire il nome abbreviato di un mese per un'espressione data.

Esempio 1

Dim MyVar
MyVar = MonthName(10)  
'Output: October

Esempio 2

Dim MyVar1
MyVar1 = MonthName(10, True)  
'Output: Oct

Esempio 3

Dim MonthNumber2, MyVar2
MonthNumber2 = 5
MyVar2 = MonthName(MonthNumber2)  
'Output: May

Esempio 4

Dim Month1, Month2, Month3
Month1 = MonthName(1)     
Month2 = MonthName(2, True) 
Month3 = MonthName(12)      
Output: January
Output: Feb
'Output: December