Thread: Stop timer.
View Single Post
  #6   Report Post  
Posted to microsoft.public.excel.programming
Harald Staff[_3_] Harald Staff[_3_] is offline
external usenet poster
 
Posts: 4
Default Stop timer.

Hi Karthi

For a simple solution, do a test for something before Application.ontime.
Here you stop it by putting anything in the neighbor cell:

If ThisWorkbook.Sheets("Sheet1").Range("h7").Value < "" Then Exit Sub
Application.OnTime Nexttick, "Clock"

A boolean public variable is probably a better choice.

HTH. Best wishes Harald


"Karthik" skrev i melding
...
Hi All,

I copied a script from discussions given below to prepare a rudementary
clock.

Sub Clock()
ThisWorkbook.Sheets("Sheet1").Range("g7").Value = CDbl(Time)
NextTick = Now + TimeValue("00:00:01")
Application.OnTime NextTick, "Clock"
End Sub

I would like to have a seperate macro to stop this clock from calculating.

Thanks for your help in advance.....!

--
Karthi