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


Got the Time? Understanding the ins and outs of working with times and dates can be confusing. Remove the confusion--ExcelTips: Times and Dates is an invaluable resource for learning how best to work with times and dates.
 
Check out ExcelTips: Times and Dates today!

Helpful Links

Ask an Excel Question
Make a Comment

Tips.Net Home
Vital News Home

ExcelTips FAQ
ExcelTips Premium

Learn Access Now

Beauty Tips
Bugs and Pests Tips
Car Tips
Cleaning Tips
College Tips
Cooking Tips
Excel2007 Tips
ExcelTips
Family Tips
Gardening Tips
Health Tips
Home Tips
Money Tips
Organizing Tips
Pet Tips
Word2007 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.)