Microsoft Excel is one of the most useful applications available, and we can utilize a dataset unlimitedly using Excel‘s features and tools. In this article, we will discuss how to construct a simple stopwatch. A stopwatch clock can assist us in keeping track of how much time is left to complete a task or how much time remains until a deadline. With this in mind, we will examine the step-by-step techniques of How to Create a Stopwatch in Excel.
Download Practice Workbook
Please click on the link below this paragraph if you want a free copy of the sample workbook covered in the presentation.
What Is a Stopwatch?
A Stopwatch is a tool for tracking how long something takes to happen. This type of watch stands out as exceptional in terms of how precisely it can record the passage of time. We must use a timer to precisely record an event’s duration. Intuitively set the timers. To begin counting, push the start button. A timer will freeze time at the end of the event if the stop button is pressed.
Step-by-Step Procedures to Create Stopwatch in Excel
If we know the proper steps, it can be easy to use Excel to make a Stopwatch. This post will show you how to make a Stopwatch clock in Excel in 6 steps. In the first step, it will show the time. We’ll write VBA code throughout the following three steps to start, stop, and re-start the watch. In the next step, we’ll discuss how to make buttons and link them to macros in the Stopwatch Timer. Last but not least, we will test the Time-tracker in the previous step. Follow these steps carefully to figure out how to create a Stopwatch in Excel.
Step 1: Display Stopwatch Clock in Excel
In the first part of this procedure, you’ll learn how to make a simple clock that looks good. Please follow the steps below to set up the Timer.
- First of all, select the B4:C4Â range.
- Secondly, navigate to the Home tab.
- Thirdly, choose the Merge and Center option from the Alignment group, and Middle and Center align.
- After that, from the Font group, select the fill color as Blue Lighter 80% and pick the Bold and All Border.
- At this time, again, from the Home tab and click the Expand icon from the Number group.
- Subsequently, the Format Cells will appear.
- Later, select Custom and write h:mm:ss in the Type box.
- Then, hit OK.
- Next, pick the B4 cell and input 0:00:00.
- Finally, hit Enter, which will produce the desired Clock like the below one.
Step 2: Establish VBA Macro to Start Stopwatch
In the second step, we will write some VBA code to initiate the Stopwatch. Here, we will declare a public countdown variable, and consequently, we can access this variable via many procedures.
- First, go to the Developer tab and then click on Visual Basic.
- Second, click Insert and then Module to get a Module Box.
- Third, copy and paste the code below into the Module Box.
Option Explicit
Public countDown As Date
Sub StartTimer()
countDown = Now + TimeValue("00:00:01")
Range("B4") = Range("B4") + TimeValue("00:00:01")
Application.OnTime countDown, "StartTimer"
End Sub
- In this case, we gave the Procedure Name the name StartTimer. The Stopwatch App starts up when this Macro is run.
- Press the Ctrl + S key now.
Step 3: Generate Another Macro to Reset Time-Tracker
Currently, we must create another macro to reset the Clock so that we can utilize this Timer regularly. Initially, we will use this Macro to set the clock time to 0 seconds. Please follow the below directions to complete the assignment.
- Like before, open the same Module.
- After that, put the following code in the Module Box.
Sub ResetTimer()
Range("B4") = TimeValue("00:00:0")
End Sub
- In this part, we called ResetTimer the Procedure Name. This Macro can reset the Clock.
- Now, hit Ctrl + S .
Step 4: Build Last Macro to STOP Stopwatch in Excel
We will build a technique for stopping the Time-tracker in the following part. Please follow the directions below to complete the assignment.
- Similarly, open the Module. Module1 is what we call it in our study.
- Then, type the code below into the Module Box to make another Macro called StopTimer.
Sub StopTimer()
Application.OnTime EarliestTime:=countDown, Procedure:="StartTimer", Schedule:=False
End Sub
- We will use this Macro, in particular, to stop the Time-tracker App.
- Tap the Ctrl + S key next.
Step 5: Implement Buttons for Stopwatch
Finally, we will design buttons to increase the interactivity of our program. Here, we’ll create three buttons and assign previously-created macros to each.
- To start, visit the Developer tab.
- Second, from the Controls group, tap on the Insert icon.
- Then, a small bar will appear.
- Then, from the Form Controls, choose the Button symbol.
- Currently, make a rectangle right below the B4Â cell.
- As a result, the Assign Macro window will display.
- At this point, choose the StartTimer procedure, followed by OK.
- Now, click on the button’s text area and click on the Home tab.
- After that, choose Middle and Center align from the Alignment group.
- Afterward, click on the B icon and change the font size to 20.
- Last, change the name of the button. In this case, it’s START.
- Make another button to stop or pause, just like you did before.
- Now, draw this button and place it below Button1.
- Because of this, it will show the Assign Macro window.
- Next, click on the Macro called StopTimer, then click OK.
- Now, click on the text area of the button and then on the Home tab.
- Then, click the B icon and change the font size to 20.
- Afterward, in the Alignment group, choose Middle and Center align.
- Last, change what the button is called. It is indeed STOP in this case.
- Like before, make another button to reset.
- Now, draw this button and put it under the Button2.
- As a result, the Assign Macro window will appear.
- Then, click on the Macro called ResetTimer, and click OK.
- Now, click the button’s text area and then the Home tab.
- Then, click the B symbol and change the font size to 20.
- Then, in the Alignment section, choose Middle and Center align.
- Last, change the button’s name. In this situation, it is RESET.
Step 6: Check Stopwatch Timer
Now, we’ll put our Stopwatch App to the test. First, we’ll start over with the Time-tracker. After that, we can start it up and turn it off.
- Click the Reset button to start.
- Press the STARTÂ button.
- Tap the STOP button when you’re done.
- Then, set the Stopwatch Timer back to Zero.
- Press the START button now.
- Press STOP when you’re done.
- Tap the RESET button again right now.
- So, the Stopwatch Timer is working precisely as it should.
Conclusion
You can Create A Stopwatch in Excel by following the steps below. The ExcelDemy Website provides further articles with the comparable subject matter. Please provide any additional recommendations or enhanced techniques as you continue to use them. Remember to put your thoughts, questions, and instructions in the space provided.