Showing a progress message

A

Asif

I am writing a code in which I am updating several files from a main data
sheet. I just want to show a progress message which would display the file
name being processed. I tried to use the "Msgbox " statement but it would
stop to code while being displayed, where I want the message to stay on while
the code being executed.

Any help to this will be much appreciated.
 
R

RB Smissaert

This is a very simple way to show a progress in the statusbar:

Sub StatusProgressBar(lCounter As Long, _
lMax As Long, _
lInterval As Long, _
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
 
B

brzak

One of the simpler ways would be to make use of statusbar.

E.g.

Sub StatusBar_demo()
Dim i As Long
For i = 1 To 1000
Cells(i, 1).Value = i 'put
Application.StatusBar = "Your Text Here (" & i & " of 1,00)"
Next i

Application.StatusBar = False 'reset the status bar
End Sub
 

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