bottom
Great ExcelTips!
         
Your e-mail address is safe!
Close Note

Tips.Net > ExcelTips Home > Macros > Assigning Macros to Graphics

Assigning Macros to Graphics

Summary: Depending on your version of Excel, macros are usually added to toolbars and menus. You can also add them to graphics, so that the macro is executed when someone clicks on the graphic. This tip explains how to establish that relationship between a graphic and a macro. (This tip works with Microsoft Excel 97, Excel 2000, Excel 2002, Excel 2003, and Excel 2007.)

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:

  1. Right-click on the graphic. Excel displays a Context menu.
  2. Select the Assign Macro option from the Context menu. Excel displays the Assign Macro dialog box. (Click here to see a related figure.)
  3. Select the macro you want associated with the graphic.
  4. Click on OK.

Save your workbook and test out your assignment by clicking on the graphic. The macro should run, as desired.

Tip #2971 applies to Microsoft Excel versions: 97 | 2000 | 2002 | 2003 | 2007


Save Time and Money! Many people need to keep track of employee time, but don't know where to start when it comes to creating a spreadsheet. Here's a way to save time, effort, and money with ready-to-use timesheet templates.
 
Check out Timesheet Templates today!

Helpful Links

Ask an Excel Question
Make a Comment

Tips.Net Home

ExcelTips FAQ
ExcelTips Premium

Learn Access Now

Bugs and Pests Tips
ExcelTips
Family Tips
Health Tips
Home Tips
Organizing Tips
WordTips

Advertise on the
ExcelTips Site

 

Great Info!

Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your e-mail address and click "Subscribe."
     
(Your e-mail address will never be shared with anyone, ever.)