Creating a Running clock in excel without any button to start or stop clock

Ravi181229

Board Regular
Joined
May 18, 2014
Messages
72
Hi,

Is it possible to create a running clock (MM DD YYYY and Date) with time and date in two different colums. I dont want to create any button. clock should start running once excel workbook is opened. Any Ideas.
 

Excel Facts

Format cells as date
Select range and press Ctrl+Shift+3 to format cells as date. (Shift 3 is the # sign which sort of looks like a small calendar).
Alt+F11 to bring up the VBA editor. In the ThisWorkbook module, paste the following:

Rich (BB code):
Private Sub Workbook_Open()

Application.OnTime Now + TimeSerial(0, 0, 1), "UpdateTimer"

End Sub

Insert a new module and paste this:

Rich (BB code):
Public Sub UpdateTimer()

Sheet1.Cells(1, 1).Value = Format$(Now, "mm/dd/yyyy")
Sheet1.Cells(1, 2).Value = Format$(Now, "hh:nn:ss")

Application.OnTime Now + TimeSerial(0, 0, 1), "UpdateTimer"

End Sub

Change those red lines as suits.

WBD
 
Upvote 0
Hello Everyone, I needed this to learn.. How to put a running clock on Cell A1 & landed in this tread.

The solution that you provided works, unfortunately the clock does not auto start when i close & open the excel file.
Can someone help me out here.. I dont want a Button to start / stop the clock.

I want the clock to be running (Auto) all the time the excel file is open.
 
Upvote 0

Forum statistics

Threads
1,214,392
Messages
6,119,257
Members
448,880
Latest member
aveternik

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