How to create a stop watch in Excel



How to create a stop watch in Excel
Using VBA create a stop watch in Excel. Define a macro for each of the buttons. Record time allotted
For more help visit my website

I am able to provide online help on your computer for a reasonable rate.

MY videos are all created on Camtasia.

Follow me on Facebook

Dim Tick As Date, t As Date
Sub stopwatch()

t = Time
Call StartTimer

End Sub

Sub StartTimer()
Tick = Time + TimeValue(“00:00:01”)
Range(“F11”).Value = Format(Tick – t – TimeValue(“00:00:01”), “hh:mm:ss”)
Application.OnTime Tick, “StartTimer”
End Sub

Sub StopTimer()
On Error Resume Next
Application.OnTime EarliestTime:=Tick, Procedure:=”StartTimer”, Schedule:=False
End Sub

Watch more new videos about Excel Office | Synthesized by Mindovermetal English

Rate this post

Bài viết liên quan

Theo dõi
Thông báo của
guest
3 Comments
Cũ nhất
Mới nhất Được bỏ phiếu nhiều nhất
Phản hồi nội tuyến
Xem tất cả bình luận
Catherine Mendez

Hi there – I'm having trouble with this code and hoping you could provide insight. I can't zero out the stopwatch after using. It restarts where it left off. Also, when you stop, instead of it restarting fromm the next second – i.e stops at 00:05:36, you restart it 10 seconds later, the watch will start at 00:05:46, rather than 00:05:37. I'm trying to use this stopwatch on a timesheet to track total time per tasks. Thank you so much in advance.

Tamer Morsy

Hi, thanks for sharing
can I use this way to set a countdown timer for several items in the same worksheet?

Poutine Au Syrop d'érable

What's doing the "Time counting" in your program?