View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
JLGWhiz JLGWhiz is offline
external usenet poster
 
Posts: 3,986
Default Display date and time

If you want it as a call up message box. Using your macro with an added line.

Private Sub txtTimeDAte_Change()
Dim MyDate
MyDate = Now ' MyDate contains the current system date.
MyDate = Format(MyDate, "dd,mmm yy hh:mm:ss AMPM ")
MsgBox MyDate
End Sub

If you want it on the worksheet, pick a cell and type "=Now()" without the
quote marks.



"Julian" wrote:

How can i display the date and time at real-time?Below is the script. Please
advice..

Private Sub txtTimeDAte_Change()

Dim MyDate

MyDate = Now ' MyDate contains the current system date.

txtTimeDAte.Text = Format(MyDate, "dd,mmm yy hh:mm:ss AMPM ")

End Sub


Julian