Programming Excel/Vba Partii Handout: Msgbox Button Values

Download as pdf or txt
Download as pdf or txt
You are on page 1of 1

Programming Excel/VBA PartII handout

MsgBox button values:


Excel constant vbOKOnly vbOKCancel vbAbortRetryIgnore vbYesNoCancel vbYesNo vbRetryCancel vbCritical vbQuestion vbExclamation vbInformation vbDefaultButton1 vbDefaultButton2 vbDefaultButton3 vbDefaultButton4 vbApplicationModal vbSystemModal vbMsgBoxHelpButton VbMsgBoxSetForeground vbMsgBoxRight vbMsgBoxRtlReading 0 1 2 3 4 5 16 32 48 64 0 256 512 768 0 4096 16384 65536 524288 1048576 Value Description Display OK button only. Display OK and Cancel buttons. Display Abort, Retry, and Ignore buttons. Display Yes, No, and Cancel buttons. Display Yes and No buttons. Display Retry and Cancel buttons. Display Critical Message icon. Display Warning Query icon. Display Warning Message icon. Display Information Message icon. First button is default. Second button is default. Third button is default. Fourth button is default. Application modal; the user must respond to the message box before continuing work in the current application. System modal; all applications are suspended until the user responds to the message box. Adds Help button to the message box Specifies the message box window as the foreground window Text is right aligned Specifies text should appear as right-to-left reading on Hebrew and Arabic systems

MsgBox return Values:


Return Values (Excel constant) vbOK vbCancel vbAbort vbRetry vbIgnore vbYes vbNo 1 2 3 4 5 6 7 Return Values (numerical) OK Cancel Abort Retry Ignore Yes No Button selected

You might also like