Loading bar

Vbanoob98

Board Regular
Joined
Sep 13, 2019
Messages
128
Hi, so I have 10 macros that I call

I would like to add a loading bar that increments in % as each macro finishes

E.g.

Call macro1
Loading bar shows 10%
Call macro2
Loading bar shows 20%
Etc etc

Any ideas?
 

Excel Facts

Shade all formula cells
To shade all formula cells: Home, Find & Select, Formulas to select all formulas. Then apply a light fill color.
I somewhat understand how to put it inside the code.

What I would like it maybe to make a loop for all my call macros and each call macro that successfully ends makes the loading bar % increase
 
Upvote 0
Directions:
You can download preset form files here and use them like this...

In VBA editor, Insert File... Navigate to the .frm file you download from above
Next add the following code to your current macro sub
VBA Code:
frmProgressIndicator.Show
Call macro1
frmProgressIndicator.updateProgress (10)
Call macro2
frmProgressIndicator.updateProgress (20)
'Etc etc 
frmProgressIndicator.updateProgress (100)
'maybe pause for a second then 
frmprogressindicator.Hide
 
Upvote 0
This is good. The issue is that when the first box comes, you have to close it for the rest to continue, and the the other boxes dont come up
 
Upvote 0
This is good. The issue is that when the first box comes, you have to close it for the rest to continue, and the the other boxes dont come up
Apologies change the form Property ShowModal to False, or just download the updated file, and it will work just fine as it does with this code, as I forgot that option initially:
VBA Code:
Private Sub MacroTest()
  frmProgressIndicator.Show
  Application.Wait (Now + TimeValue("00:00:01"))
  For i = 1 To 10
    frmProgressIndicator.updateProgress (i * 10)
    DoEvents
    Application.Wait (Now + TimeValue("00:00:01")) ' Simulate Macro execution
  Next i
  Application.Wait (Now + TimeValue("00:00:01"))
  frmProgressIndicator.Hide
End Sub
 
Last edited:
Upvote 0
Thanks for updating us! :) Glad to help! Change the StartUpPosition property :cool: CenterScreen or CenterOwner
Works amazing! Last question, how could I make it appear in the center of the workbook?
 
Upvote 0

Forum statistics

Threads
1,215,067
Messages
6,122,949
Members
449,095
Latest member
nmaske

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