Excel Progress Bar while Calculating

G

Guest

I have a pivot table in which I programmatically show/hide two variables
based on user input. This updates the pivot table and also about six other
worksheets which take about 4 minutes (that was the max I observed). During
this time, the status bar displays 'Calculating nn% done...'.

But I would also like to show a progress bar either as a userform or in the
status bar.
Is that possible? If so, how? How do I increment it and when do I stop,
since recalculation is not in my control.

Thanks a lot.
 
G

gimme_this_gimme_that

Have you considered writing to the status bar?

Application.StatusBar = "Completed task A starting task B"
 
R

RB Smissaert

Or something like this:


Sub StatusProgressBar(lCounter As Long, _
lMax As Long, _
lInterval, _
Optional strText As String)

Dim lStripes As Long

If lCounter Mod lInterval = 0 Or lCounter = lMax Then
lStripes = Round((lCounter / lMax) * 100, 0)
Application.StatusBar = strText & _
String(lStripes, "|") & _
String(100 - lStripes, ".") & "|"
End If

End Sub


RBS
 

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