0% found this document useful (0 votes)
69 views

HandoutMsgBox - 1str PDF

This document provides information about constants used for message box buttons and icons in Excel VBA, including the constant value, description, and which button each constant corresponds to. It lists constants for different button combinations like OK/Cancel, Yes/No, as well as icons for critical, question, and information messages. It also outlines constants that control default button selection and window modality.

Uploaded by

Erin Yates
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
69 views

HandoutMsgBox - 1str PDF

This document provides information about constants used for message box buttons and icons in Excel VBA, including the constant value, description, and which button each constant corresponds to. It lists constants for different button combinations like OK/Cancel, Yes/No, as well as icons for critical, question, and information messages. It also outlines constants that control default button selection and window modality.

Uploaded by

Erin Yates
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

Programming Excel/VBA PartII handout

MsgBox button values:


Excel constant Value Description

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 5 Display Retry and Cancel buttons.

vbCritical 16 Display Critical Message icon.

vbQuestion 32 Display Warning Query icon.

vbExclamation 48 Display Warning Message icon.

vbInformation 64 Display Information Message icon.

vbDefaultButton1 0 First button is default.

vbDefaultButton2 256 Second button is default.

vbDefaultButton3 512 Third button is default.

vbDefaultButton4 768 Fourth button is default.

vbApplicationModal 0 Application modal; the user must respond to the message


box before continuing work in the current application.

vbSystemModal 4096 System modal; all applications are suspended until the
user responds to the 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:

Return Values (Excel constant) Return Values (numerical) Button selected

vbOK 1 OK

vbCancel 2 Cancel

vbAbort 3 Abort

vbRetry 4 Retry

vbIgnore 5 Ignore

vbYes 6 Yes

vbNo 7 No

You might also like