ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   msgbox buttons (https://www.excelbanter.com/excel-programming/299033-msgbox-buttons.html)

jmikerea

msgbox buttons
 
Can anyone tell me why in Excel 2000 I can only produce a msgbox with a vbokonly button. In j-walks book Excel 2002 Power Programming with VBA, chapter 8 pg 200 it says that I should be able to have various arrangements of buttons

xld

msgbox buttons
 
Don't know why you can't, but MsgBox supports all sorts of buttons as
its buttons arguement
vbOKOnly 0 Display OK button only.
VbOKCancel 1 Display OK and Cancel buttons.
VbAbortRetryIgnore 2 Display Abort, Retry, and Ignore buttons.
VbYesNoCancel 3 Display Yes, No, and Cancel buttons.
VbYesNo 4 Display Yes and No buttons.
VbRetryCancel

You can also set other flags, such as vbcritical. See the help for
details.


---
Message posted from http://www.ExcelForum.com/


Frank Kabel

msgbox buttons
 
Hi
just define the second parameter of msgbox accordingly.
e.g.
msgbox("test",vbAbortRetryIgnore)

-----Original Message-----
Can anyone tell me why in Excel 2000 I can only produce a

msgbox with a vbokonly button. In j-walks book Excel 2002
Power Programming with VBA, chapter 8 pg 200 it says that
I should be able to have various arrangements of buttons
.


Chip Pearson

msgbox buttons
 
What code are you using? The buttons and their captions are
determined by the second argument to the MsgBox function. If you
omit this second argument, the default is vbOKOnly. Try, for
example, code like

MsgBox "Click", vbOKCancel
MsgBox "Click", vbYesNo
MsgBox "Click", vbRetryCancel

See the on line help for MsgBox for more details about the
constants you can provide to control the buttons.


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com




"jmikerea" wrote in message
...
Can anyone tell me why in Excel 2000 I can only produce a

msgbox with a vbokonly button. In j-walks book Excel 2002 Power
Programming with VBA, chapter 8 pg 200 it says that I should be
able to have various arrangements of buttons



jmikerea[_2_]

msgbox buttons
 
Thanks for the help.


All times are GMT +1. The time now is 02:53 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com