Datasheet
Chapter 1: Using Macros and Form Controls
25
The macros you assign to a control only execute when the corresponding event occurs for the control. For
example, you may have a macro assigned to a control that computes the total amount to be paid when the
user clicks the control. If you change the values needed to compute the total amount after a user clicks the
control, Excel does not update the total until the user clicks the control again.
If you no longer want a macro to be assigned to a control, right-click the control and then click the Assign
Macro option. In the Assign Macro dialog box, clear the macro name from the Macro Name field and then
click OK. Excel removes the macro assignment from the control, but the macro remains as part of the
workbook. To remove the macro from the workbook, click the View tab and then click Macros in the Macros
group to display the Macro dialog box. Select the macro you want to delete and then click Delete.
4
4 Click the control with the assigned macro.
Excel executes the associated macro.
•
In this example, Excel assigns postage to the
invoice.
04_132302 ch01.qxp 7/27/07 9:20 PM Page 25