Thread: date function
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
NickHK NickHK is offline
external usenet poster
 
Posts: 4,391
Default date function

Various ways:

Private Sub CommandButton1_Click()
Dim TheMonth As Long

TheMonth = Month(Now())
Debug.Print TheMonth
Debug.Print MonthName(TheMonth, False)
Debug.Print MonthName(TheMonth, True)
Debug.Print Format(Now(), "dd/mmmm/yyyy")
End Sub

NickHK

"Chinx21" . wrote in message
...
help pls.. how can I get the month of a whole date. example March 2, 2007.
should return only the Month which is March.Thanks!