Excel Progress Bar problem

G

go4ravi

Hi All friends!

How can i display progress bar when some macro of Excel file is running.

How can i indicate user that which record is being processed out of
total.

Is there possible that i can use same userform(progressbarForm) to
display progress bar for different different macros?
Thanx

Ravi Patel


*** Sent via Developersdex http://www.developersdex.com ***
 
J

Jim Cone

Ravi,
You should consider whether a dynamic message in the StatusBar would suffice.
It is easier to accomplish and requires less overhead...
'--
For i = 1 To lngTotal
Application.StatusBar = "Working " & Format$(i / lngTotal, "00%")
'some code
Next
'Don't forget this...
Application.StatusBar = False
--
Jim Cone
San Francisco, USA
http://www.realezsites.com/bus/primitivesoftware
(Excel Add-ins / Excel Programming)



"go4ravi" <meet>
wrote in message Hi All friends!
How can i display progress bar when some macro of Excel file is running.
How can i indicate user that which record is being processed out of
total.

Is there possible that i can use same userform(progressbarForm) to
display progress bar for different different macros?
Thanx

Ravi Patel


*** Sent via Developersdex http://www.developersdex.com ***
 
R

RB Smissaert

Or you could use this function, which will put a simple
progressbar in the statusbar.

Function MakeProgressString(lCounter As Long, _
lMax As Long, _
lInterval As Long, _
Optional lWidth As Long = 100, _
Optional strText As String) As String

Dim lStripes As Long

If lWidth = 0 Then
lWidth = 100
End If

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

End Function


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