Hi, I am using a stopwatch script that allows me to start, stop and reset in the active cell. The only problem I have is that when I go back to a previous cell with the time already inserted, it resets back to 00:00. I would like to continue the time from the previously inserted time. For example if I want to start from 00:00 I would first have to enter it into the cell and then press reset or if 10:00 is inserted it will reset to 10:00 and when start is pressed it will continue to count up from 10:00. Another way to say it is that I would like the stopwatch to start from whatever time is already inserted in the cell. Any help would be much appreciated.
Here is the code that I am using:
Dim StopTimer As Boolean
Dim SchdTime As Date
Dim Etime As Date
Const OneSec As Date = 1 / 86400#
Private Sub ResetBtn_Click()
StopTimer = True
Etime = 0
[ActiveCell].Value = "00:00:00"
End Sub
Private Sub StartBtn_Click()
StopTimer = False
SchdTime = Now()
[ActiveCell].Value = Format(Etime, "hh:mm:ss")
Application.OnTime SchdTime + OneSec, "Foglio1.NextTick"
End Sub
Private Sub StopBtn_Click()
StopTimer = True
Beep
End Sub
Sub NextTick()
If StopTimer Then
'Don't reschedule update
Else
[ActiveCell].Value = Format(Etime, "hh:mm:ss")
SchdTime = SchdTime + OneSec
Application.OnTime SchdTime, "Foglio1.NextTick"
Etime = Etime + OneSec
End If
End Sub
Bookmarks