Message box

  • Thread starter Thread starter Pat
  • Start date Start date
P

Pat

The following messagebox contains two buttons. To have a message contained
in the messagebox also but not on the actual buttons what alteration should
I make?

ans = MsgBox("OK", vbOKCancel)
If ans = vbCancel Then Exit Sub

Pat
 
Hi Pat,
The following messagebox contains two buttons. To have a message contained
in the messagebox also but not on the actual buttons what alteration should
I make?

ans = MsgBox("OK", vbOKCancel)
If ans = vbCancel Then Exit Sub

Not sure if I understand what your problem is, but the "OK" part of the code
above can be changed, e.g. to this:

ans = MsgBox("Hit OK" & vbNewLine & "Or hit Cancel!",vbOKCancel)

Regards,

Jan Karel Pieterse
Excel MVP
www.jkp-ads.com
 
You do not have the option of not showing any buttons: by default, the OK
button is shown.
 
The message I posted was not correct I have since realised the information
was what I wanted.

Thank you both for your help.
Pat
 

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

Back
Top