Msg Box to Appear??

H

hce

Hi

Can anyone please show me how i can get a message box to appear onc
the macro is activated and disappear once the macro is done...? th
macro is activated via the command button on a useform... currently,
am using the status bar to display the message i want to show but it i
not obvious enough... i have also tried to use the progress applet a
shown in pearson's website but due to my lack of vb knowledge i wasn'
able to modify the progress applet to run according to my macro...
would really appreciate any help/advice provided...

cheer
 
P

Patrick Molloy

add a userform witha lable...the default is label1.
add the forrlowing sub to a standard module...

Sub MyButtonCode()

Dim i As Long
Dim t As Long
UserForm1.Show False

For i = 1 To 1000
t = Timer
UserForm1.Label1.Caption = i
UserForm1.Repaint
Do
doevents
Loop Until Timer > (t + 1)

Next

End Sub


the code loads the form in mode-less ...that means that the code continues
while the form is visible
 
T

Tom Ogilvy

Just some added information.

A msgbox is modal - it holds the focus and no code runs while it is
displayed, so a msgbox will not work for this.
 

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