Message box.

  • Thread starter Thread starter Tom
  • Start date Start date
T

Tom

Hello again,

how can I dislpay some massage during run macro.

for example:

Sub Makro1()

*** Display some Message ***
..
..
..
..

*** Shut off Message ***

End Sub

Thanks Tom
 
Tom,

If you use the msgbox, it requires that the user press a key, and
discontinues processing while waiting.

You could use a modeless userform that has your message:

Load UserForm1
UserForm1.Show vbModeless
'Other code here
UserForm1.Hide
Unload UserForm1

Or write your message to the status bar:

Application.StatusBar = "This is my message"
'other code
Application.StatusBar = False

HTH,
Bernie
MS Excel MVP
 
Tom,

If you want the macro to stop and wait for a response, use MsgBox. If you
want it to keep running, you can make your own UserForm and show it modeless
(xl2000+):

UserForm1.Show vbModeless

Or you can put stuff on the status bar as the macro marches on:

Application.StatusBar = "Doing stuff"
..
..
Application.StatusBar = "Doing other stuff"
..
..
Application.Statusbar = False ' resets status bar to Excel control

Chip Pearson has a neat "Alerter" in which you can put various messages into
a box as your code runs. www.cpearson.com
 
Back
Top