MsgBox'es

MDTyKe

New Member
Joined
Feb 19, 2004
Messages
46
Alright, Ive been using message boxes throughout my spreadsheet, such as:

MsgBox "Please now fill in the details. Only those colored in white are necessary. Press 'Confirm Order' to complete the order", vbOKOnly, "Information"

However, you know the way there is the proper information boxes, with the question mark etc in it, like you have in data validation. Is there any thing especially for it, maybe an alternative for "vbOKOnly" or something?

Matt
 

Excel Facts

Lock one reference in a formula
Need 1 part of a formula to always point to the same range? use $ signs: $V$2:$Z$99 will always point to V2:Z99, even after copying
MsgBox "Test", vbInformation

The second parameter determine's what type of message box to show. You have a ton of different options to choose from. Hope this helps.
 
Upvote 0
here ya go,

'these are some
MsgBox ("asdf"), vbCritical
MsgBox ("zxcv"), vbOKCancel
MsgBox ("qwerty"), vbOKOnly
MsgBox ("poiu"), vbQuestion
MsgBox ("mnbv"), vbYesNo
MsgBox ("something here.."), vbYesNoCancel
'and there are others


there are others too. check out the help files.

from microsoft help files...

The following constants can be used anywhere in your code in place of the actual values:

MsgBox Arguments
Constant Value Description
vbOKOnly 0 OK button only (default)
vbOKCancel 1 OK and Cancel buttons
vbAbortRetryIgnore 2 Abort, Retry, and Ignore buttons
vbYesNoCancel 3 Yes, No, and Cancel buttons
vbYesNo 4 Yes and No buttons
vbRetryCancel 5 Retry and Cancel buttons
vbCritical 16 Critical message
vbQuestion 32 Warning query
vbExclamation 48 Warning message
vbInformation 64 Information message
vbDefaultButton1 0 First button is default (default)
vbDefaultButton2 256 Second button is default
vbDefaultButton3 512 Third button is default
vbDefaultButton4 768 Fourth button is default
vbApplicationModal 0 Application modal message box (default)
vbSystemModal 4096 System modal message box
vbMsgBoxHelpButton 16384 Adds Help button to the message box
VbMsgBoxSetForeground 65536 Specifies the message box window as the foreground window
vbMsgBoxRight 524288 Text is right aligned
vbMsgBoxRtlReading 1048576 Specifies text should appear as right-to-left reading on Hebrew and Arabic systems



MsgBox Return Values
Constant Value Description
vbOK 1 OK button pressed
vbCancel 2 Cancel button pressed
vbAbort 3 Abort button pressed
vbRetry 4 Retry button pressed
vbIgnore 5 Ignore button pressed
vbYes 6 Yes button pressed
vbNo 7 No button pressed
 
Upvote 0
If you want to customize the message box you need to just make your own userform. Then you can customize a lot of things the way you want.
 
Upvote 0

Forum statistics

Threads
1,214,583
Messages
6,120,380
Members
448,955
Latest member
BatCoder

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top