You will have to save the date and time in B6 to substract from Now..If you
want to handle a blank entry in B6 use another variable
Sub RClock1()
Dim varTemp
varTemp = Sheets("Timing Sheet").Range("B6")
If varTemp = 0 then varTemp = Now
UserForm1.RaceClock1.Text = Worksheetfunction.text(Now - _
varTemp,"[h]:mm:ss")
NextTick = Now + TimeValue("00:00:01")
Application.OnTime NextTick, "RClock1"
End Sub
If this post helps click Yes
---------------
Jacob Skaria
NDBC said:
Sorry Jacob, I didn't make myself clear. I never run the form without having
a time in cell b6. I had just reset the time in b6 so when i started the form
i was expecting a time of say 00:00:10 or less but got 960696:00:10. i save
the time in cell b6 using the format "hh:mm:ss". Maybe I need to save the
date as well. Could that be it.
Thanks.
:
May be we will have to handle the 0 value.
If Sheets("Timing Sheet").Range("B6").Value > 0 Then
UserForm1.RaceClock1.Text = WorksheetFunction.Text(Now - _
Sheets("Timing Sheet").Range("B6"), "[h]:mm:ss")
End If
If this post helps click Yes
---------------
Jacob Skaria
:
Jacob, I think it is almost there. the minutes and seconds now start at zero
but the hours (are shown) start at 960696. So at time zero the timer shows
960696:00:00.
Thanks for you efforts.
:
Try
Sub RClock1()
Watch = Now - Sheets("Timing Sheet").Range("B6")
UserForm1.RaceClock1.Text = Worksheetfunction.text(Now - _
Sheets("Timing Sheet").Range("B6"),"[h]:mm:ss")
NextTick = Now + TimeValue("00:00:01")
Application.OnTime NextTick, "RClock1"
End Sub
If this post helps click Yes
---------------
Jacob Skaria
:
I have the following code for a timer on a form. the time in cell b6 is the
start time of the race. I want it to work for races that go for > than 24
hours. I have tried formatting it as "[hh]:mm:ss" but the hours disappear and
the timer starts at 8 minutes for some reason regardless of what the start
time is. Any ideas.
Thanks
Sub RClock1()
Watch = Now - Sheets("Timing Sheet").Range("B6")
UserForm1.RaceClock1.Text = Format(Watch, "hh:mm:ss")
NextTick = Now + TimeValue("00:00:01")
Application.OnTime NextTick, "RClock1"
End Sub