Create A Stopwatch in Excel

hrayani

Well-known Member
Joined
Jul 23, 2010
Messages
1,475
Office Version
  1. 2016
Platform
  1. Windows
Hello To All,

How can i input a stopwatch in excel sheet with a Start, Stop, and Reset Button....

Awaiting reply,

Humayun
 

Excel Facts

Workdays for a market open Mon, Wed, Friday?
Yes! Use "0101011" for the weekend argument in NETWORKDAYS.INTL or WORKDAY.INTL. The 7 digits start on Monday. 1 means it is a weekend.
Thanks Vog

I will have a loot at it now and will let you know shortly

Regards,

Humayun
 
Upvote 0
Dear Vog

I just downloaded the file.... But, i want a stopwatch with a Start, Stop and Reset button on the sheet...

Whereas, the one you told me is without any buttons and also i am unable to stop it...

Can u help me??

Humayun
 
Upvote 0
Dear Vog,

Pls let me know that is it possible to have a stopwatch through Vba

Like if we can create 3 command buttons. (1, START 2,STOP 3,RESET)
and then can assign some codes to that so we can have the stop watch on the sheet

Is is possible??? Can u help me with the codes?

Humayun
 
Upvote 0
Try in a regular module

Code:
Dim NextTick As Date, t As Date

Sub StartClock()
t = Time
Call TickTock
End Sub

Private Sub TickTock()
Range("A1").Value = Format(Time - t, "hh:mm:ss")
NextTick = Now + TimeValue("00:00:01")
Application.OnTime NextTick, "TickTock"
End Sub

Sub StopClock()
Application.OnTime earliesttime:=NextTick, procedure:="TickTock", schedule:=False
End Sub

Sub Reset()
Call StopClock
Range("A1").Value = 0
End Sub

You can assign StartClock, StopClock and Reset to buttons from the Forms toolbar.
 
Upvote 0
Dear Vog,

I have pasted the codes in the regular module.. Now i have also created three button on the screen named START STOP and RESET..

Pls tell me what to do further ???

i am unable to proceed without your help

Humayun
 
Upvote 0
Right click each button in turn and select Assign Macro and assign the appropriate sub. Then click the start button to start the stopwatch which is displayed in A1.
 
Upvote 0
Dear Vog,

Thanks very much for your help. One last question the time i am getting on the screen is for example 0:00:02 can we increase the second to mili seconds like 0:00:000002

Humayun
 
Upvote 0

Forum statistics

Threads
1,213,546
Messages
6,114,251
Members
448,556
Latest member
peterhess2002

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top