I am trying to find some codes on Youtube to help me learn to display timer/stopwatch on a target label.
What I am trying to do is that the timer should start from zero upon clicking the start button, and pause upon clicking submit button, and reset to zero upon clicking the reset button.
The code I got so far is
Private Sub UserForm_Activate() //Doesn't work on renaming the function to StartTime()
Do
If CM = True Then Exit Sub
Label6.Caption = Format(Now, "hh:mm:ss")
DoEvents
Loop
End Sub
"Now" function starts from current time , but I want it to start from zero. I tried something like this:
Tick = Time + TimeValue("00:00:01")
label6.Caption = Format(Tick - t - TimeValue("00:00:01"), "hh:mm:ss")
But it doesn't seem to work this is also starting my timer automatically when I run the program. Any suggestions on how I may be able to achieve my objective on my target label?