Hello,
Im trying to create a progress indicator for a lengthy macro code. I've used this tutorial te recreate a progress bar:
However, this tutorial assumes you want to rerun the same code over and over again until the loop is done.
What I want is something like this:
1. Start sub step1
2. Show progress @ 10%
3. Call sub step2
4. Show progress @ 20%
5. Call sub step 3
6. Show progress @ 30%
7. Halfway sub step 3, Show progress @ 35%, continue at the line last executed in sub 3
8. Show progress @ 40%
9. Call sub step 4
etc. etc.
This is the current code of the progress bar.
I was thinking of working with GoTo commands but perhaps there is a more elegant solution.
Im trying to create a progress indicator for a lengthy macro code. I've used this tutorial te recreate a progress bar:
HTML:
http://www.excel-easy.com/vba/examples/progress-indicator.html
However, this tutorial assumes you want to rerun the same code over and over again until the loop is done.
What I want is something like this:
1. Start sub step1
2. Show progress @ 10%
3. Call sub step2
4. Show progress @ 20%
5. Call sub step 3
6. Show progress @ 30%
7. Halfway sub step 3, Show progress @ 35%, continue at the line last executed in sub 3
8. Show progress @ 40%
9. Call sub step 4
etc. etc.
This is the current code of the progress bar.
Code:
Sub Progress(sinPro As Single, strPro As String)
UserForm1.Text.Caption = strPro
UserForm1.Bar.Width = (sinPro / 11) * 200
DoEvents
End Sub
I was thinking of working with GoTo commands but perhaps there is a more elegant solution.