Using Controls

You can place controls — such as buttons, check boxes, and list boxes — on worksheets, chart sheets, or dialog sheets (you cannot place controls on a module). Placing controls on a dialog sheet creates a custom dialog box.

One advantage of placing controls on a worksheet is that you can put them close to the data they're used with. Another advantage of placing controls on a worksheet is that you can create a document that looks like a dialog box but contains cells that recalculate automatically.

By using a dialog box to group controls together, on the other hand, you can reduce the degree of complexity that confronts a user who's working with a system of worksheets and procedures you've developed. You can keep the user interface for your application uncluttered so that the user isn't overwhelmed with infrequently used options. To minimize errors on a worksheet, you can isolate the process of entering data from that of transferring the data to the worksheet. You can also create dialog boxes that apply to many worksheets or charts or to the Microsoft Excel environment as a whole.

The following sections discuss placing and using controls on worksheets, chart sheets, and dialog sheets. Most of the techniques for using controls are the same, no matter what sheet type you use. In this section, the term "sheet" refers to a worksheet, chart sheet, or dialog sheet. This discussion is followed by the "Using Custom Dialog Boxes" section, which details the specific issues involved in working with custom dialog boxes.