Microsoft Office Tutorials and References
In Depth Information
RUN A MACRO FROM A BUTTON
Figure 110. You can change properties in the
Properties dialog to change the appearance of the
With the button still in Design mode, click the View Code icon. This is the
third icon in the Control Toolbox—a magnifying glass looking at a sheet.
When you click View Code, you are taken to a brand new macro in the VBA
editor. The new macro lives on the code sheet for the workbook.
You can write the macro steps in this new macro. Or, if you want to call an
existing macro, simply type the name of the macro as the only code in the
macro, as shown in Figure 111.
Figure 111. When you click View Code, you are taken to a
new macro on the code pane for the worksheet.