Hi Phil,
I have a macro that involves running several other macros in a row, to get the final result.
It's called New_Comp (module 10) in ScreenRunner.xlsm
It takes about 45 seconds on MS Office Home and Student 2016 with Windows 10.
Is there a way to display a Progress Bar while the several macros are running?
Cheers,
Aussie Mark
Hi Mark,
Can you supply the workbook plz?
Phil
Hi Phil,
I have attached the ScreenRunner.xlsm file to this message but its over the limit (I think that happened yesterday too).
I'll send you a Dropbox link to ScreenRunner.xlsm, so you can then have a go at running it.
I've attached a summary of the macos in the meantime so you can see how it runs.
The main macro I'd like the Progress BAr on is the New_Comp macro
Cheers,
Mark
Hi Mark,
Please see attached. This code is taken from here
I've rewritten the code to be more adaptable, so that when initialized, you can specify the number of steps it takes to get to 100%.
As you are calling 13 subs, you can specify Steps = 13 before calling InitProgressBar (Steps).
If you change the number of subs you're calling just change the value of Steps to match.
I've put the code in Module10 and added the necessary calls in your New_comp sub.
I've also included a TestProgressBar() sub so you can play about with it.
Regards
Phil
Hi Phil,
Many thanks for setting up the Progress Bar for me.
I noticed it appeared better in your TestProgressBar module when I run the loop at... For counter = 1 To 10000
As you highlighted, it slows the Progress Bar down enough so viewers can see it progressing.
How would I place that loop in the New_Comp module (which runs the 13 macros one after another)?
I tried placing a "pause" break after every 3 macros, and could see the Bar better, but I don't think this is the best practice.
Cheers,
Mark
no worries Mark.
You can copy/paste the loop into the ShowProgress sub to create an artificial delay - see attached.
Though I'd be happy if my code was quick enough not to need a progress bar 🙂
Regards
Phil