Display progress of a macro

L

Laurence Lombard

Is there something like a status bar which gives one information about the
progress of a macro

Something like
"Sub 1 executing"
"Sub 2 executing - 50 lines processed"
"Done"

A Msgbox could work, but that halts the process - I do not want to halt the
process. The immediate window could work, but then the VB editor must be
open.

I think I recall seeing something, but cannot find it now.
Thanks
Laurence
 
D

Dave Peterson

There is something exactly like a Statusbar. In fact, it's called Statusbar
<vbg>.

sub aaaa()
application.statusbar = "Hi from aaaa"
'more stuff
application.statusbar = "even more stuff???"
'even more stuff
application.statusbar = false 'to give it back to excel.
end sub

In case not everyone has it visible (tools|options|view tab|Status Bar), you can
make sure with:

Application.DisplayStatusBar = True
 
E

Earl Kiosterud

Laurence,

If you have Excel 2000 or later, you can use a modeless UserForm. It
appears on the screen in the middle (or elsewhere), but the macro keeps
running, and can put stuff in the Userform ("Now formatting drive C" etc.)
as it runs. Check out www.cpearson.com. for the alerter, and also a
progress bar.
 
L

Laurence Lombard

Thanks Dave - once again the NG does not disappoint. Interestingly, I
searched VB help and could not find the information, even after having half
an idea what I was looking for! (Searced "Status", browsed the Contents
etc). The VBA help has greater potential of being helpful (saying that, I
must acknowledge that Excel is a very impressive application)

Laurence
 
Top