Creating a Dialog Sheet

To create a custom dialog box, you must first insert a new dialog sheet.

To insert a new dialog sheet

1. On the Insert menu, point to Macro, and then click Dialog.

Microsoft Excel inserts a new dialog sheet on top of the current sheet in the active workbook and places within it a dialog box frame containing an OK button and a Cancel button.

2. To change the name that will appear at the top of the dialog box, select the text at the top of the dialog box frame, and then type a new name.

3. To change the size of the dialog box, drag a sizing handle until the dialog box frame is the size you want.

Note

Although you can change the location of a dialog box frame on its dialog sheet, you cannot set or change the position of the displayed dialog box using Visual Basic. Microsoft Excel displays the resulting dialog box with its upper-left corner in the same position as the last dialog box displayed, regardless of whether it was a built-in or custom dialog box. For more information, see "Displaying the Custom Dialog Box" later in this chapter.

After you've created a dialog sheet, you choose and place controls on the sheet using the same process you used to place controls on a worksheet or chart sheet. For more information, see "Choosing and Placing Controls" earlier in this chapter.