View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
Bob Phillips Bob Phillips is offline
external usenet poster
 
Posts: 10,593
Default Real-time clock in excel

Is clock in a standard module (it should be)?

Does B1 have the value X (it shouldn't, except to stop the clock)?

Do you fire the procedure initially somehow?

What does not working mean?

--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)

"Daoud Fakhry" wrote in message
...
Hi all,
I have used the following VBA code to have the real time clock in one of
my
cells. but it is not working. can any one help me.

Sub clock()
If ThisWorkbook.Worksheets(1).Range("B1").Value = "X" Then Exit Sub
ThisWorkbook.Worksheets(1).Range("A1").Value = Format(Now, "hh:mm:ss
AM/PM")
Application.OnTime Now + TimeSerial(0, 0, 1), "clock"
End Sub