Thinking In Windows

Elements, Collections, Objects, Properties, Methods, and Procedures

Assigning a Macro to Your Own Graphic Object

Sometimes you might want to attach your macro to a graphic object.  A graphic object is a picture that you paste into Microsoft Excel from another application or import from the Microsoft Excel clipart library.  A graphic object can make your macro easier to remember and use and make your worksheet more attractive.  Assigning a macro to a graphic object is done in much the same way that you assign a macro to a button on a worksheet (as in the last workshop).  So, first let's insert a graphic from the Microsoft Excel clipart library into your worksheet (the same procedure would be used to import your own graphic object). 

Inserting clipart from the Microsoft Excel clipart library

If the Microsoft Clip Gallery was installed when Microsoft Office was installed on your machine, then you can insert clip art in your workbook by using the Clip Art command (Insert menu, Picture submenu).  (If the Clip Gallery has not been installed, then use "Help" to find information about how to install it.)

    To insert clip art (or an imported picture)

  1. From the Insert menu, choose Picture (which presents a number of options)
  2. In the pop-up window, choose Clip Art . . .
  3. Pick a clip art piece of your own choosing from the Microsoft Clip Gallery categories presented and click the "Insert" button
  4. Size and move the inserted clip art to your own specifications
  5. Right click the clip art that you just inserted
  6. Click "Assign Macro" on the popup menu
  7. In the Macro Name box, enter the name of the macro that you created for the last workshop (or choose the name of the macro listed, if you are in the Excel file in which you created that macro)
  8. Click OK and then Close

In the next week's workshop, we'll create a "simple" pivot table. See you then!

If you have a question, then click here

Return to main menu