I have created Macro using Userform and it has many controls which are Static in nature and displays upon userform intialization. But it also has (Userform initialize code) code written add checkboxes in one of the frame dynamically using the data in the sheet1. which is taking a bit of time(say 30 sec-1 min) depending on the data present in the sheet.
during this period i want to user to be shown a progress bar of % completion.
I tried Application.Statusbar functionality but it didnt workout. So thought to go for Progressbar. Can anyone please help in this regard?
This is the progress bar I've used for the last five or six years (originally posted in http://www.mrexcel.com/forum/excel-questions/527468-progress-bar.html).
I'd follow Rorys advice though and use a listbox if you're creating potentially hundreds of controls.
Create a form called 'Progress Bar'
Give it these dimensions:
Name: ProgressBar
Height: 49.5
Width: 483.75
ShowModal: False <---- Important this bit or it won't update properly.
Add a label to the form with these dimensions:
Name: BoxProgress
Caption: BoxProgress
Height: 18
Left: 6
Top: 6
Width: 468
BackColour: &H008080FF&
In a normal module add this procedure:
Use it in your code like this:
You'll need to call the procedure every time you want the progress bar to update.
The variables:
m represents the maximum number the bar will reach and n represents the current value to display.