Excel Progress Bar problem

  • Thread starter Thread starter go4ravi
  • Start date Start date
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
 
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
 
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
 
Back
Top