Timer Update

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi

Is there any way I can have a counter in a cell, ie start at 0 and add 1
every second.

Thanks
 
Chronomètre: http://boisgontierjacques.free.fr/fichiers/Evenementiel/ChronoSimple.xls

Public ProchainChrono, Départ
Sub Demarre()
Départ = Timer()
majChrono
End Sub

Sub majChrono()
Sheets("Chrono").[A1] = Format((Timer() - Départ) / 3600 / 24,
"hh:mm:ss")
ProchainChrono = Now + TimeValue("00:00:1")
Application.OnTime ProchainChrono, "majChrono"
End Sub

Sub Arret()
On Error Resume Next
Application.OnTime ProchainChrono, Procedure:="majChrono",
Schedule:=False
End Sub

JB
 
Thanks Jacques, it works a treat


JB said:
Chronomhtre: http://boisgontierjacques.free.fr/fichiers/Evenementiel/ChronoSimple.xls

Public ProchainChrono, Dipart
Sub Demarre()
Dipart = Timer()
majChrono
End Sub

Sub majChrono()
Sheets("Chrono").[A1] = Format((Timer() - Dipart) / 3600 / 24,
"hh:mm:ss")
ProchainChrono = Now + TimeValue("00:00:1")
Application.OnTime ProchainChrono, "majChrono"
End Sub

Sub Arret()
On Error Resume Next
Application.OnTime ProchainChrono, Procedure:="majChrono",
Schedule:=False
End Sub

JB


Hi

Is there any way I can have a counter in a cell, ie start at 0 and add 1
every second.

Thanks
 
Back
Top