Using Custom Controls in Your Application

You use the Forms toolbar to choose a control and place it on the sheet. After you've placed the control, you set its initial properties, such as whether a check box appears checked or whether a button should be resized when an underlying cell on a worksheet is resized.

Next, you can assign a Visual Basic procedure to the control. When the user clicks a button, check box, or option button, or when the user edits the text in an edit box, Visual Basic runs the associated procedure.

You can also link a control directly to a cell on a worksheet, without using procedures. This way, you can simplify the user interface for a worksheet so that the user can set options using the mouse rather than by typing data in a cell. For example, you can group a series of check boxes that represent options in a feasibility study and then link each check box to a cell used elsewhere on the worksheet. If the user selects a check box, the value linked to the worksheet cell becomes True, and the worksheet is recalculated. For more information about linking controls to cells, see "Linking Controls to Worksheet Cells" later in this chapter.