Progress Bar Strategy

J

jasonsweeney

I have read many posts on this site re: creating progress bars. I hav
a few general questions that I could not find answers to in thes
posts:

(1) Can someone please explain when (and when not) the "show v
modeless" is required for userform that is a progress bar

- I ask because I have userforms that start lengthy procedures tha
need a progress bar indicator (lets call this the "main" userform, an
imagine there is a commandbutton that when pressed begins a routin
that takes 25 seconds). But when I try and bring a new progress-ba
userform and try to adjust the length of the bar via code in the Mai
userform, nothing happens (because the progress-bar user form is no
the active window). When I try to open the userform in vb modeless
get an error because the Main form is not VB modeless also....

I get around this by putting the code IN the progress bar userform.
Drawback is I have to create a new progress bar userform for eac
procedure (I have 5 progress bar userforms in my latest spreadsheet).
What I want to do is create just one generic progress bar userform tha
can be controlled from whatever procedure that needs it.

(2) Is there a way to track the progress of Excel's calculation? Here
I have 2,500 cells organized in a matrix with a complex formula i
each. If one cell changes they all have to change. It takes about 1
seconds for this to happen. But the code that starts this is simpl
pasting about 500 values in a vertical column.

Example: Sheet1.range("A1").pastespecial [etc.] -- creates a 15 secon
pause.

tracking progress in loop procedures is easy...what about this? Ca
you track the progress of excel's calculations when no loop in the VB
is present
 
T

Tom Ogilvy

Track calculation - no

Modal Userform:
You can use one progress bar - it doesn't have to have the code in the
userform - the userform only has to execute the code by calling it. You
would use a case statement and indicate to the userform which procedure to
run. It would call the procedure contained in a general module.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top