Thread: Time ticker
View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
K Dales[_2_] K Dales[_2_] is offline
external usenet poster
 
Posts: 1,163
Default Time ticker

Thanks Tom (& Chip)! I had figured how to stop it with user intervention but
not how to automate it; MS documentation was not clear about the need to
specify the exact time.
--
- K Dales


"Tom Ogilvy" wrote:

http://www.cpearson.com/Excel/ontime.htm

has the solution.

--
Regards,
Tom Ogilvy

"K Dales" wrote in message
...
Just found a problem with the code if you try to close the workbook: the
OnTime method will reload the workbook. Not sure yet of the best

solution,
but if I find one will let you know.
--
- K Dales


"K Dales" wrote:

Put this in the Workbook_Open() event procedu
Private Sub Workbook_Open()

TimeOpened = Now()
Application.OnTime Now + TimeValue("00:00:01"), "Ticker"

End Sub

and then insert a module and add this code:
Public TimeOpened As Date

Public Sub Ticker()

Workbooks("BookName").Worksheets("Sheet1").Range(" A1") = Now -

TimeOpened
Application.OnTime Now + TimeValue("00:00:01"), "Ticker"

End Sub

A few notes:
- The display of the date will "freeze" if you are editing a cell's

contents
but will pick up with the correct time when you are done editing
- Since this runs every second it could be a nuisance and take up

processing
time from other tasks - it could be adjusted to update less frequently,

if
desired
- If you are not familiar with how to use event procedures, search this
forum on that topic
--
- K Dales


"Soniya" wrote:

how can i get a time ticker running in a cell?

like how much time I am in the current worksheet.

If I can have a stop watch in cell A1 from 00:00:00 ?

Thanks