Syntax :
sMonth = MonthName ( MonthNbr , [ Abbrev ] )
MonthNbr : A numeric value designating a month.
Abbrev : A Boolean value that indicates whether the month will return abbreviated or fully spelled out. The default value is False ; therefore, if this argument is omitted, the month is fully spelled out. Abbrev is optional.
sMonth = MonthName ( MonthNbr , [ Abbrev ] )
MonthNbr : A numeric value designating a month.
Abbrev : A Boolean value that indicates whether the month will return abbreviated or fully spelled out. The default value is False ; therefore, if this argument is omitted, the month is fully spelled out. Abbrev is optional.
Function SpellMonth ( sString as String ) as String
If IsNumeric ( sString ) Then
If Val ( sString ) > 0 And Val ( sString ) < 13 Then
SpellMonth = MonthName ( sString)
Else
MsgBox sString & " is not a valid entry "
End If
Else
MsgBox sString & " is not a valid entry "
End If
End Function
If IsNumeric ( sString ) Then
If Val ( sString ) > 0 And Val ( sString ) < 13 Then
SpellMonth = MonthName ( sString)
Else
MsgBox sString & " is not a valid entry "
End If
Else
MsgBox sString & " is not a valid entry "
End If
End Function
No comments:
Post a Comment