Return Value of Canceled Dialog Box in ExcelLast reviewed: November 2, 1994Article ID: Q32867 |
The information in this article applies to:
SUMMARYWhen a custom dialog box is terminated with the Cancel button, the value returned by the dialog box function is FALSE. The value will be returned on the macro sheet in the cell containing the dialog box function, not in the init/result column for the Cancel button in the dialog box definition area.
MORE INFORMATIONTo perform additional processing based on whether or not the Cancel or OK button was pressed in the dialog box, interrogate the =DIALOG.BOX() statement in the macro using an IF() statement such as the following, where Cell A2 contains =DIALOG.BOX() and Cells A24 and B34 are other statements in a macro or subroutines:
=IF(A2<>false,GOTO(A24),GOTO(B34))This statement will cause the control of the macro to jump to Cell A24 and continue executing if the OK button is pressed in the dialog box, or to jump to Cell B34 if the Cancel button is pressed.
REFERENCES"Microsoft Excel Function Reference," version 3.0, pages 57-58 "Microsoft Excel User's Guide," version 3.0, pages 634-635
|
KBCategory: kbusage
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |