• Skip to main content
  • Skip to header right navigation
  • Skip to site footer

My Online Training Hub

Learn Dashboards, Excel, Power BI, Power Query, Power Pivot

  • Courses
  • Pricing
    • Free Courses
    • Power BI Course
    • Excel Power Query Course
    • Power Pivot and DAX Course
    • Excel Dashboard Course
    • Excel PivotTable Course – Quick Start
    • Advanced Excel Formulas Course
    • Excel Expert Advanced Excel Training
    • Excel Tables Course
    • Excel, Word, Outlook
    • Financial Modelling Course
    • Excel PivotTable Course
    • Excel for Customer Service Professionals
    • Excel for Operations Management Course
    • Excel for Decision Making Under Uncertainty Course
    • Excel for Finance Course
    • Excel Analysis ToolPak Course
    • Multi-User Pricing
  • Resources
    • Free Downloads
    • Excel Functions Explained
    • Excel Formulas
    • Excel Add-ins
    • IF Function
      • Excel IF Statement Explained
      • Excel IF AND OR Functions
      • IF Formula Builder
    • Time & Dates in Excel
      • Excel Date & Time
      • Calculating Time in Excel
      • Excel Time Calculation Tricks
      • Excel Date and Time Formatting
    • Excel Keyboard Shortcuts
    • Excel Custom Number Format Guide
    • Pivot Tables Guide
    • VLOOKUP Guide
    • ALT Codes
    • Excel VBA & Macros
    • Excel User Forms
    • VBA String Functions
  • Members
    • Login
    • Password Reset
  • Blog
  • Excel Webinars
  • Excel Forum
    • Register as Forum Member

Progress Bar while running several macros in a row|VBA & Macros|Excel Forum|My Online Training Hub

You are here: Home / Progress Bar while running several macros in a row|VBA & Macros|Excel Forum|My Online Training Hub
Avatar
sp_LogInOut Log In sp_Registration Register
sp_Search Search
Advanced Search|Last Search Results
Search
Forum Scope




Match



Forum Options



Minimum search word length is 3 characters - maximum search word length is 84 characters
sp_Search Search
sp_RankInfo
Lost password?
sp_CrumbsHome HomeExcel ForumVBA & MacrosProgress Bar while running several …
sp_PrintTopic sp_TopicIcon
Progress Bar while running several macros in a row
Avatar
mark allison

Active Member
Members
Level 0
Forum Posts: 3
Member Since:
May 27, 2020
sp_UserOfflineSmall Offline
1
May 27, 2020 - 10:08 am
sp_Permalink sp_Print

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

Avatar
Philip Treacy
Admin
Level 10
Forum Posts: 1509
Member Since:
October 5, 2010
sp_UserOfflineSmall Offline
2
May 27, 2020 - 10:55 am
sp_Permalink sp_Print

Hi Mark,

Can you supply the workbook plz?

Phil

Avatar
mark allison

Active Member
Members
Level 0
Forum Posts: 3
Member Since:
May 27, 2020
sp_UserOfflineSmall Offline
3
May 28, 2020 - 4:08 pm
sp_Permalink sp_Print

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

Avatar
Philip Treacy
Admin
Level 10
Forum Posts: 1509
Member Since:
October 5, 2010
sp_UserOfflineSmall Offline
4
May 28, 2020 - 8:53 pm
sp_Permalink sp_Print sp_EditHistory

Hi Mark,

Please see attached.  This code is taken from here

VBA Progress Bar

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

Avatar
mark allison

Active Member
Members
Level 0
Forum Posts: 3
Member Since:
May 27, 2020
sp_UserOfflineSmall Offline
5
June 3, 2020 - 7:22 pm
sp_Permalink sp_Print

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

Avatar
Philip Treacy
Admin
Level 10
Forum Posts: 1509
Member Since:
October 5, 2010
sp_UserOfflineSmall Offline
6
June 4, 2020 - 12:42 pm
sp_Permalink sp_Print

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

sp_Feed
Go to top
Forum Timezone: Australia/Brisbane
Most Users Ever Online: 245
Currently Online: adam elias
Guest(s) 10
Currently Browsing this Page:
1 Guest(s)
Top Posters:
SunnyKow: 1432
Anders Sehlstedt: 870
Purfleet: 412
Frans Visser: 346
David_Ng: 306
lea cohen: 219
A.Maurizio: 202
Jessica Stewart: 202
Aye Mu: 201
jaryszek: 183
Newest Members:
Lawrence Miu
Jo Saies
Paul Pritchard
Monique Roussouw
Keith Aul
Richard Dunks
Manjula Mangalmurti
Thomas Quidort
Jamie Preece
Bob Smith
Forum Stats:
Groups: 3
Forums: 24
Topics: 6192
Posts: 27146

 

Member Stats:
Guest Posters: 49
Members: 31848
Moderators: 3
Admins: 4
Administrators: Mynda Treacy, Philip Treacy, Catalin Bombea, FT
Moderators: MOTH Support, Velouria, Riny van Eekelen
© Simple:Press —sp_Information

Sidebar

Blog Categories

  • Excel
  • Excel Charts
  • Excel Dashboard
  • Excel Formulas
  • Excel PivotTables
  • Excel Shortcuts
  • Excel VBA
  • General Tips
  • Online Training
  • Outlook
  • Power Apps
  • Power Automate
  • Power BI
  • Power Pivot
  • Power Query
microsoft mvp logo
trustpilot excellent rating
Secured by Sucuri Badge
MyOnlineTrainingHub on YouTube Mynda Treacy on Linked In Mynda Treacy on Instagram Mynda Treacy on Twitter Mynda Treacy on Pinterest MyOnlineTrainingHub on Facebook
 

Company

  • About My Online Training Hub
  • Disclosure Statement
  • Frequently Asked Questions
  • Guarantee
  • Privacy Policy
  • Terms & Conditions
  • Testimonials
  • Become an Affiliate

Support

  • Contact
  • Forum
  • Helpdesk - For Technical Issues

Copyright © 2023 · My Online Training Hub · All Rights Reserved. Microsoft and the Microsoft Office logo are trademarks or registered trademarks of Microsoft Corporation in the United States and/or other countries. Product names, logos, brands, and other trademarks featured or referred to within this website are the property of their respective trademark holders.