Skip to main content

Create a Running Clock in Excel With a Macro

Joshua earned an MBA from USF and writes mostly about software and technology.

Create a simple macro that will run a clock in a workbook.

Create a simple macro that will run a clock in a workbook.

Create a Macro

Here we will walk through how to run a clock in Excel with a macro. Steps are shown on a Mac computer, but tasks in Windows will be similar.

Start this process by clicking on the view tab followed by clicking on the view macros button.

create-a-running-clock-in-excel-with-a-macro

Type in a macro name or use Runclock with no spaces. Click on the plus button. In Windows press the create button after a name is created.

create-a-running-clock-in-excel-with-a-macro

Next, type in or paste the code shown below. Be sure to change the range to the cell where you would like the clock to appear in.

Sub Runclock() Range("B1").Value = Now Application.OnTime Now + TimeValue("00:00:01"), "runclock" End Sub

create-a-running-clock-in-excel-with-a-macro

Attach the Macro to a Button

Click on the insert tab followed by clicking the shapes button. Choose a shape to use as a button.

create-a-running-clock-in-excel-with-a-macro

Right-click on the button and click assign macro.

create-a-running-clock-in-excel-with-a-macro

Select the Runclock macro and choose OK. Deselect the button by clicking in any cell.

create-a-running-clock-in-excel-with-a-macro

Run the Clock

Click on the button to get the clock started. You may need to adjust the width of the column used for the time/date to be visible.

create-a-running-clock-in-excel-with-a-macro

Format the Clock

Select the cell with the clock and select the format drop-down in the home tab to change the format.

create-a-running-clock-in-excel-with-a-macro

Choose a standard format in the time or date section. I used a custom format to show a specific time and date format in this example.

create-a-running-clock-in-excel-with-a-macro

Additional Considerations

You may use the clock anywhere in the workbook. So you may hide the initial clock created with the macro but use that clock to create multiple clocks by equaling that cell and adjusting the format in those cells used to support the clock.

This content is accurate and true to the best of the author’s knowledge and is not meant to substitute for formal and individualized advice from a qualified professional.

© 2022 Joshua Crowder