I think there are a couple of points that may be confusing to you
First,
The .Value property of the progress bar is 1 to 100, or implied percent.
so, you have to figure out when your "job" is 1%, 2%, 10%... whatever,
then update the .value of the Progress bar with this number.
Second, Craig's example doesn't seem to be for Excel, (probably for Access).
The way I would handle it:
If your userform name is: ProgressForm
and your progress bar name is: ProgressBar1
then the Value property is set by:
ProgressForm.ProgressBar1.Value = (some calculated integer from 1 to 100)
Next, your question about having the macro wait until the userform exits
before
continuing.
The term for this is called "modal" (no idea why, and I don't care!)
the default for your userform is "modal", you want a "modalless" form.
To do that, in your properties box, set ShowModal to False.
I think you can use
Progressform.ShowModal = false
in your script before you issue the Progressform.Show
but then, you'd have to remember to due that any time you use this form.
It's easier to just put it in the Properties.
I created:
Sub Progbar()
Dim inx, Modcnt, I, Percnt
ProgressForm.Show
ProgressForm.ProgressBar1.Value = 0
Modcnt = Int(65000 / 100)
For I = 1 To 65000
If (I Mod Modcnt = 0) Then
Percnt = I / Modcnt
Application.StatusBar = Percnt
ProgressForm.ProgressBar1.Value = Percnt
If (Percnt Mod 10 = 0) Then Application.Wait (Now +
TimeValue("0:00:01"))
End If
Next I
Unload ProgressForm
Application.StatusBar = False
End Sub