The Forms Toolbar

Along with the macro recorder, Excel comes with a few other controls similar to ActiveX controls that are designed for use with recorded macros. The controls are available from the Forms toolbar and can be accessed through the View menu in the Excel Application (see Figure 4.13).

Most of these controls are the same as the controls on the Control toolbox and their functions are basically the same. The difference: how the controls on the Forms toolbar are used. These controls are designed for non-programmers to use with recorded macros; therefore, they do not have code windows other than the module containing the recorded macro. To attach a macro to a control from the Forms toolbar, first draw the control on a worksheet and right click on the control to view its menu, then select Assign Macro. The Assign Macro dialog box, shown in Figure 4.14, will appear with a list of all available procedures (any procedure declared with the Public keyword) currently open in Excel.

The Forms toolbar.

The Assign Macro Dialog Box.

The Assign Macro Dialog Box.

Select the procedure you want to execute and click the OK button. The macro will be assigned to the major event of the control (typically a Click() event).

You can use these controls to initiate VBA procedures just as you would with controls from the Control toolbox; however, you sacrifice considerable flexibility with respect to properties and events associated with the control. Nevertheless, if all you need is code initiation, the Forms toolbar controls offer a simple set of tools.

Was this article helpful?

0 0
Biorhythm Awareness

Biorhythm Awareness

Who else wants to take advantage of biorhythm awareness to avoid premature death, escape life threatening diseases, eliminate most of your life altering mistakes and banish catastrophic events from your life.

Get My Free Ebook

Post a comment