How to determine the progress of a macro?

DamageZ

New Member
Joined
Aug 20, 2010
Messages
25
Hi All,

I currently am using a very lengthy macro that opens and updates 30 other spreadsheets. It currently takes between 9 and 15 minutes depending on what is doing.

I have a very basic screen update built into it that shades a progressive cell in black to show its progress.

I have looked at many other forums and web pages depicting progress bars and showing how to update the status bar, however, I haven't been able to figure out how to get excel to guesstimate how much longer it will take to finish running the macro. Is this even possible?

Thanks to everyone in advance.
 

Excel Facts

Easy bullets in Excel
If you have a numeric keypad, press Alt+7 on numeric keypad to type a bullet in Excel.
All you need to do is log the time you start the macro. As you loop through the sheets subtract the time started from the time now, Divide the result by the number of sheets you have processed so far then multiple the result by the total number of sheets you are processing.

The result is how long it should take all up. To calculate the remaining time simply subtract the time taken so far from this figure.
 
Upvote 0
All you need to do is log the time you start the macro. As you loop through the sheets subtract the time started from the time now, Divide the result by the number of sheets you have processed so far then multiple the result by the total number of sheets you are processing.

The result is how long it should take all up. To calculate the remaining time simply subtract the time taken so far from this figure.
Thanks for the quick reply :)

I had the same idea, but some of the workbooks are larger than the others. So your suggestion is along the same lines as my current solution. Which only really gives me a guide as to how many workbooks have been processed so far.

I was hoping that VB some how estimated the time it would need to complete the macro.
 
Upvote 0
Unfortunately no because it doesn't know how long something it hasn't done will take. I have used the method i mentioned before but ended up canning the whole thing and going back to a simple "XX% complete" because of the potential to be so inaccurate for the reasons you mentioned.
 
Upvote 0
Bugger! I thought that was going to be the case. I was hoping against all odds that there was some sort of super brain built into it.

Thansk for your help BH :biggrin:
 
Upvote 0

Forum statistics

Threads
1,214,945
Messages
6,122,393
Members
449,081
Latest member
JAMES KECULAH

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