Show timer when running a long macro

Son

Active Member
Joined
Mar 19, 2010
Messages
284
Hello! When I ran a long macro, I use a textbox in a userform with a label, telling the user to wait. The textbox has also a nice image for them to look at.

However, I'd like to show the user how long this takes, by using a timer counting how long the process takes.

So for example, if the user sees that 15mins have passed, he'll know that the macro is about to finish. The following code works but only states the time that the macro began.

It is useful if the user compares this to the current time. But I'd much rather prefer that they saw a timer on the label or somewhere else. Could this be done?

And also, do you have any other suggestions about what else I could show to make the user more interested instead of bored when waiting for the macro to finish? This long running macro uses a combination of various macros, some of which are manipulating the status bar showing various messages.

Your ideas would be most appreciated!!!

VBA Code:
Sub Live_time()
    Application.OnTime Time + TimeValue("00:00:01"), "Live_time"
    UserForm1.Label1 = Time
    UserForm1.Repaint
End Sub

Private Sub UserForm_Initialize()
lblMessage.Caption = Processing_Message & " " & Time
Application.OnTime Time + TimeValue("00:00:01"), "Live_time"
End Sub
 

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).
Not something I've ever done, but Andy Pope has a collection of progress meters here
 
Upvote 0
Thanks for your reply, but I am not looking for a progress bar, I'd like to have a timer on the userform label if that's possible.
 
Upvote 0
In that case I'm afraid I cannot help. As I said it's not something I've had need of.
 
Upvote 0

Forum statistics

Threads
1,215,455
Messages
6,124,937
Members
449,196
Latest member
Maxkapoor

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