1

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?

  • See if you can adapt [this answer](https://stackoverflow.com/a/56811408/4717755) to your needs. – PeterT Nov 07 '22 at 20:22
  • I have done it in excel already on specified cells. I was trying to show timer on the label of my design form as mentioned in the question rather than showing timer on specified cells. – Habeeb E Sadeed Nov 07 '22 at 20:27

0 Answers0