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

Previously I had discussed about 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 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 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 size just look 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 of the file. Click here to download.

Puspendu is the founder author of Excelabcd. He is a creative person, blogger and Excel-maniac guy.

Tagged with: , , , , ,
2 comments on “Lesson#81: Making an automatic analog clock in excel with 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 *

*