Article ID: 129073
Article Last Modified on 8/15/2005
=TEXT(MONTH(NOW()),"mmm")Microsoft Excel will always return the result "Jan".
=TEXT(MONTH(NOW()),"mmm")If the current date is February 1, 1995, the function MONTH(NOW()) correctly returns the value of 2. This is equivalent to MONTH(34731) because 2/1/95 is the 34731st day after 1/1/1900. TEXT(MONTH(NOW()),"mmm") evaluates to the same value as TEXT(2,"mmm"), because 2 is the serial representation of 1/2/1900. Therefore, it returns "Jan".
=TEXT(NOW(),"mmm")The text string "Feb" is returned.
Sub Date_Format()
Test = Format(Date, "mmm")
' Returns the current month as a text string
' if the current date is 2/1/95, "Feb" (without the quotation marks).
MsgBox Test
End Sub
Additional query words: XL5 XL7 XL97 XL98 XL
Keywords: kbprogramming kbprb kbdtacode KB129073