Microsoft KB Archive/67462

{| = Excel: Button Fails to Run Correct Macro =
 * width="100%"|

Last reviewed: November 2, 1994

Article ID: Q67462

SUMMARY
When a Microsoft Excel macro is assigned to a worksheet button or a worksheet item, it must be assigned as either an absolute reference (&quot;Macro1!$A$1&quot;) or a name (&quot;Macro1!My_Macro&quot;). Assigning the macro to a relative reference (&quot;Macro1!A1&quot;) may cause the macro to produce an error, the macro to run incorrectly, or the wrong macro to run.

When relative references are used, Excel must locate the macro to be run relative to the active cell (the currently selected cell on the worksheet). Therefore, if a button is assigned to Macro1!A1, and A1 is highlighted on the worksheet, the macro will run normally. However, if B1 is highlighted on the worksheet, Excel will search for a macro at Macro1!B1.

For more information on worksheet buttons, see page 584-589 of the &quot;Microsoft Excel User's Guide&quot; version 3.0 manual.
 * }