Assign Macros in Excel: A Friendly Guide

Excel Macros
Aug 30, 2025 2 min read
Assign Macros to Shapes, Images, and Controls in Excel

Have you ever wished you could make your Excel workbooks more interactive and user-friendly? What if you could click a button, shape, or even an image and instantly run your favorite macro? Actually, it is much simpler. Today, I’m going to show you, step by step, how to assign macros to shapes, images, and controls inside Excel so you can impress yourself and others with your automation superpowers.

Let’s dive in and transform your Excel sheets from plain spreadsheets to powerful interactive tools that anyone can use—even those who don’t know a thing about macros!

Why Assign Macros to Shapes and Images?

First, a little context: macros automate repetitive tasks. Normally, to run a macro, you open the Developer tab and click the macro’s name, which can be a bit clunky. Assigning macros to shapes or images turns your workbook into a visual dashboard.

Imagine this: instead of a boring list of macros, you have colorful buttons, icons, or even pictures, and clicking any of these triggers a macro instantly. It’s a game-changer for ease of use and presentation.

Let’s Start: Assigning a Macro to a Shape

1. Insert a Shape

  • Go to the Insert tab.
  • Click on Shapes in the Illustrations group.
  • Pick any shape, like a rectangle or oval.
Insert a Shape in Excel

Draw by clicking and dragging the selected shape on your worksheet. Feel free to customize it later with colors or text.

Pro tip: Add a label directly on the shape with text like “Run Report” or “Format Table” so everyone knows what it does.

2. Assign the Macro

Here’s the magic part:

  • Right-click on the shape.
  • Select Assign Macro from the menu.
  • The Assign Macro dialog box opens.
  • Select the macro you want to assign from the list (if you haven’t created one yet, no worries—just make a simple macro first).
  • Click OK.
Assign the Macro to a shape in Excel

Moving forward, whenever you click on the shape, the macro runs!

Assigning a Macro to an Image

1. Insert an Image

  • Go to the Insert tab.
  • Click Pictures and select a picture from your computer or online sources.
  • Resize and position it where you want on your sheet.
Assign a Macro to an Image

2. Assign the Macro

Same as we did for shapes, just right-click on the image and select Assign Macro.

Think of creative images : a little printer icon to run a print macro or a checkmark for validation macros—it makes your workbook feel like an app!

Using Form Controls for More Interactive Macros

Excel also has a set of Form Controls that you can add for user-friendly macro triggers:

1. Show the Developer Tab (if not visible)

If you haven’t done this yet:

  • Go to File > Options > Customize Ribbon.
  • On the right, check Developer and click OK.

If you want to know the full steps on how to show the developer tab, read here.

2. Insert a Button (Form Control)

  • Go to Developer > Insert > Form Controls.
  • Click the Button (Form Control) icon.
  • Same as we did add shapes, add the button in your worksheet.
  • After drawing, Excel opens the Assign Macro dialog automatically.
  • Select your macro and click OK.
Assign macro to form controls in Excel

Now you have a clickable button that runs your macro on demand.

Customizing Form Controls

You can change the button’s text by right-clicking it and selecting Edit Text. These buttons can be resized, repositioned, and copied anywhere in your workbook.

Pro tip: Use buttons for complex workbooks shared across teams to make macros accessible without requiring users to know VBA.

Assigning Macros to ActiveX Controls

For more advanced users, ActiveX controls offer extra customization:

1. Insert an ActiveX Control

  • Go to Developer > Insert > ActiveX Controls.
  • Choose a button or other control.
  • Draw the control on the worksheet.

Follow the same steps as we did add in normal Form Controls in previous method

2. Link the Control to VBA Code

  • Right-click the control and select View Code.
  • The VBA editor opens automatically with a blank event procedure for that control.
  • Call your macro or any code for the added control.

Example:

Vba
Private Sub CommandButton1_Click()
    Call YourMacroName
End Sub
Important Notice

 ActiveX controls can be trickier and less stable on some Excel versions, so test carefully.

Tips for Making Your Macro-Assigned Objects Shine

  • Label clearly: Always add descriptive text or tooltips to buttons, shapes, and images.
  • Consistent design: Stick to a color scheme and shape style across your workbook.
  • Position logically: Place controls near relevant data or tables so users intuitively know where and when to click.
  • Test on other machines: Ensure your macros and controls work when you share the file with others.

Wrapping It Up

Assigning macros to shapes, images, and controls in Excel is a fantastic way to make your workbooks interactive and beginner-friendly. It turns repetitive tasks into one-click wonders and helps you build professional-quality spreadsheets that feel like custom applications.

So next time you build a macro, why not give it a colorful button or an icon? You’ll love how much easier it makes your work, and anyone who uses your workbook will thank you for it.

If you have questions or want a recipe for a specific macro-button combo, just give me a shout—let’s keep making Excel a tool we love working with!

Comments (0)

Leave a Comment

Comments are moderated before publishing.

No comments yet. Be the first to comment!

Quick Tip

Press Ctrl+1 to open Format Cells dialog for any selected range.