Please Note: This article is written for users of the following Microsoft Excel versions: 97, 2000, 2002, and 2003. If you are using a later version (Excel 2007 or later), this tip may not work for you. For a version of this tip written specifically for later versions of Excel, click here: Assigning Macros to Graphics.
by Allen Wyatt
(last updated January 29, 2019)
You already know that Excel allows you to add graphics to your worksheets, such as pictures. You may not know, however, that you can assign macros to these graphics. With a macro associated with a graphic, the macro is executed whenever someone clicks on the graphic.
To assign a macro to a graphic, follow these steps:
Figure 1. The Assign Macro dialog box.
Save your workbook and test out your assignment by clicking on the graphic. The macro should run, as desired.
ExcelTips is your source for cost-effective Microsoft Excel training. This tip (2971) applies to Microsoft Excel 97, 2000, 2002, and 2003. You can find a version of this tip for the ribbon interface of Excel (Excel 2007 and later) here: Assigning Macros to Graphics.
Professional Development Guidance! Four world-class developers offer start-to-finish guidance for building powerful, robust, and secure applications with Excel. The authors show how to consistently make the right design decisions and make the most of Excel's powerful features. Check out Professional Excel Development today!
It can be frustrating when you get error messages doing something that you previously did with no errors. If you get an ...Discover More
When writing a macro, you may want to fill a range of cells with different values. The easiest way to do this is to use ...Discover More
Want to use a worksheet function (such as SUM) from within a macro? Here's how easy it is to accomplish the task.Discover More
FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."
Got a version of Excel that uses the menu interface (Excel 97, Excel 2000, Excel 2002, or Excel 2003)? This site is for you! If you use a later version of Excel, visit our ExcelTips site focusing on the ribbon interface.