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.
Create Custom Apps with VBA! Discover how to extend the capabilities of Office 2013 (Word, Excel, PowerPoint, Outlook, and Access) with VBA programming, using it for writing macros, automating Office applications, and creating custom applications. Check out Mastering VBA for Office 2013 today!
You can create macros that run whenever Excel detects a certain event happening within an entire workbook. This tip ...Discover More
When you delete all the macros in a workbook, Excel may still think you have some there. Here's why that happens and what ...Discover More
Even if you do nothing but record macros, sooner or later you will have a need to edit what you record. Here's how to get ...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.