Returning the Button the User Chose in a Dialog Box : Dialogs « Application « VBA / Excel / Access / Word






Returning the Button the User Chose in a Dialog Box

 
 
Return Value      Button Clicked         
-2                Close        
-1                OK        
0                 Cancel        
1                 The first command button        
2                 The second command button        
>2                Subsequent command buttons      

 








Related examples in the same category

1.Set the contents of the File Name text box in the Save As dialog box in Word and then display the dialog box
2.cancel a procedure if the user clicked the Cancel button in a dialog box:
3.Specifying a Timeout for a Dialog Box
4.Display one of Excel's built-in dialog boxes and let the user make the choices: by using the Application object's Dialogs property.
5.To display Excel's Open dialog box
6.Using an Application's Built-in Dialog Boxes from VBA: wdDialogFileOpen