Lesson#81: Making an automatic analog clock in excel with a pie chart

Lesson#81: Making an automatic analog clock in excel with a pie chart

Previously I had discussed how to make an analog clock with piechart in excel. I am sharing the post link below.

Lesson#61: Making a semi-analog clock with a pie chart

Now I will add some simple VBA to make the clock auto refreshed every second. So I have taken these simple steps.

Making an automatic analog clock in excel with pie chart

1. From the Developer Tab I have inserted a Button (Form Control) and clicked on New in the Assign Macro window

Making an automatic analog clock in excel with pie chart

2. Opening the VBA editor I added this code

Sub Button2_Click()
Call refreshcell
End Sub
Sub refreshcell()
Range(“a1”).Calculate
Application.OnTime Now + TimeValue(“00:00:1”), “refreshcell”
End Sub
Making an automatic analog clock in excel with pie chart

3. Edited the button text and the size just looks good.

4. Save this sheet as a macro-enabled workbook in .xlsm format.

Now see every second this sheet is auto-refreshing the clock. I put that button to call the function refreshcell()
if the sheet doesn’t start to refresh itself automatically after opening it.

I have given the download link to the file. Click here to download.
See also  Lesson#120: What is Input Box in VBA?

Hi! I am Puspendu. I am the founder and author of Excelabcd. I am little creative person, blogger and Excel-maniac guy. I hope you enjoy my blog.

2 Comments on “Lesson#81: Making an automatic analog clock in excel with a pie chart

  1. Thx Mr.Puspendu Roy I really appreciate your work and love to read your post. thx for a giving this informative post on an excel automatic analog clock. I try it and really it’s work good… Best of luck!

Leave a Reply

Your email address will not be published. Required fields are marked *

*