Page 217 - Excel Data Analysis
P. 217
11 537547 Ch10.qxd 3/4/03 12:03 PM Page 203
FORM CONTROLS 10
The macros that you assign to a control only If you no longer want to have a macro assigned to a
execute when the corresponding event occurs control, right-click the control and then click the
for the control. For example, you may have a Assign Macro option. In the Assign Macro dialog
macro assigned to a control that computes the box, clear the macro name from the Macro Name
total amount a client must pay when a user clicks field and click OK.
the control. If you change the values to compute
the total amount after a user clicks the control, This removes the macro assignment from the
Excel does not update the total until the user control, but the macro still remains as part of the
clicks the control again. workbook. To remove the macro from the
workbook, click Tools ➪ Macros ➪ Macro to display
You can modify a macro assigned to a control by the Macro dialog box. Select the macro that you
right-clicking the control and then clicking the want to delete and click Delete.
Assign Macro option. In the Assign Macro dialog
box, select the name of the assigned macro and
click Edit. The Visual Basic Editor displays the
selected macro.
■ The Visual Basic Editor › Type the macro code. Á Click the control with the ■ Excel executes the
creates a new macro and assigned macro. associated macro.
names it after the control. ˇ Click the View Microsoft
Excel button.
203