View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Rick Rothstein \(MVP - VB\) Rick Rothstein \(MVP - VB\) is offline
external usenet poster
 
Posts: 2,202
Default How do I change Date Format ??

Pick one of these...

Private Sub CurrentTime()
MsgBox Format$(Date, "dd-mmm-yyyy")
End Sub

Private Sub CurrentTime()
MsgBox Format$(Date, "mmmm dd, yyyy")
End Sub

Rick


"Dan Thompson" wrote in message
...
My code

Sub CurrentTime()
MsgBox Date
End Sub

This procedure outputs a message box that displays the current date.
The problem I am facing is the date outputs like this "16/1/2008" and I
want it to output so it displays like this "16-Jan-2008" or "Jan 16, 2008"

Can someone help me on this ??

Dan Thompson