How to Create Shortcuts in Excel by Adding an Excel Macro Button - Pryor Learning (2024)

If you’ve ever repeated the same actions multiple times in a spreadsheet, you’ll benefit from recording a macro to automate those tasks. But, once you have a macro, how do you access it?

The easiest way is to add a macro button to your spreadsheet, for which Excel offers three straightforward methods:

  • Add a button to the Quick Access Toolbar;
  • Add a form control button; or
  • Add an ActiveX control button.


In this example, we’ll add a button for the macro titled “Say_Hello.” Before you can use any of these methods, however, you must have the Developer tab available on the ribbon.

Show the Developer Tab

Look at the far right of your Excel ribbon. If there is no “Developer” tab, then add it:

  1. From the “File” menu, choose “Options.”
  2. Choose “Customize the Ribbon.”
  3. Click the checkbox for “Developer.”

How to Create Shortcuts in Excel by Adding an Excel Macro Button - Pryor Learning (1)

1. Add a Button to the Quick Access Toolbar

The simplest way to add a button for “Say_Hello” is to add it to the Quick Access toolbar, which is displayed in the Excel window title bar.

  1. Right-click a blank area of the ribbon.
  2. Choose “Customize Quick Access Toolbar.”
  3. From the dialog box that appears, choose “Macros” for “Choose commands from:” and select your macro from the list.How to Create Shortcuts in Excel by Adding an Excel Macro Button - Pryor Learning (2)
  4. Click “Add >>” and “Save.”

Your “Say_Hello” button now appears on the Quick Access toolbar.

Although this is the easiest method, it is also the least flexible. Your “Say_Hello” button can’t appear anywhere except in the Quick Access Toolbar, and it can do nothing but run a macro.

2. Add a Form Control Button

More flexible than the Quick Access toolbar, a form control button can go anywhere in your workbook, and you control the position, size, text, and style.

  1. Choose the “Developer” ribbon.
  2. Choose “Insert | Button (Form Control).”How to Create Shortcuts in Excel by Adding an Excel Macro Button - Pryor Learning (3)
  3. Click and drag a rectangle for the “Say_Hello” button.
  4. When you release your mouse button, a macro dialog box will appear.How to Create Shortcuts in Excel by Adding an Excel Macro Button - Pryor Learning (4)
  5. Click the name of the macro that you wish to run when the user presses the “Say_Hello” button, then choose “OK.” If you haven’t yet created the macro, you can create it now with the “New” button or you can record one with the “Record…” button.

With your new “Say_Hello” button is in place, feel free right-click it, choose “Properties,” and modify the font, size, position, and other attributes.

3. Add an ActiveX Control Button

The third option, an ActiveX control button, is more powerful than a form control button because it harnesses the full range of the Visual Basic language. To create an ActiveX control button:

  1. Choose the “Developer” ribbon.
  2. Choose “Insert | Button (Form Control).”How to Create Shortcuts in Excel by Adding an Excel Macro Button - Pryor Learning (5)
  3. Click and drag a rectangle for the “Say_Hello” button.
  4. Right-click the “Say_Hello” button and choose “View Code.”How to Create Shortcuts in Excel by Adding an Excel Macro Button - Pryor Learning (6)
  5. This will bring up the Visual Basic editor.How to Create Shortcuts in Excel by Adding an Excel Macro Button - Pryor Learning (7)
  6. Be sure that the listbox in the upper right-hand corner shows “Click.”
  7. Edit your code.
  8. Save and exit the Visual Basic editor.

The ActiveX control takes a little longer than the form control to set up; however, once finished, any instructions in the “Click” subroutine will run when the user clicks the button.

Additional Options

For a quick and easy button, use Quick Access toolbar buttons or form control buttons. For the most flexibility, use ActiveX controls, which allow you to employ the full range of the Visual Basic programming language. Experiment with the language, and you’ll learn how to build a full-featured application, all from within your spreadsheet.

How to Create Shortcuts in Excel by Adding an Excel Macro Button - Pryor Learning (2024)
Top Articles
Different Types of Business Models in India and Its Advantages
The Complete Guide on Momentum Investing Strategies
Craigslist San Francisco Bay
What to Serve with Lasagna (80+ side dishes and wine pairings)
Zitobox 5000 Free Coins 2023
Craigslist Nj North Cars By Owner
Best Cheap Action Camera
Mikayla Campino Video Twitter: Unveiling the Viral Sensation and Its Impact on Social Media
Iron Drop Cafe
Dusk
Housework 2 Jab
Belly Dump Trailers For Sale On Craigslist
Sony E 18-200mm F3.5-6.3 OSS LE Review
Best Suv In 2010
Wilmot Science Training Program for Deaf High School Students Expands Across the U.S.
Tamilrockers Movies 2023 Download
Star Wars: Héros de la Galaxie - le guide des meilleurs personnages en 2024 - Le Blog Allo Paradise
Craigslist Free Stuff Merced Ca
V-Pay: Sicherheit, Kosten und Alternativen - BankingGeek
Exterior insulation details for a laminated timber gothic arch cabin - GreenBuildingAdvisor
Indiana Wesleyan Transcripts
Craigslist Pet Phoenix
A Cup of Cozy – Podcast
eugene bicycles - craigslist
پنل کاربری سایت همسریابی هلو
Relaxed Sneak Animations
Safeway Aciu
Meowiarty Puzzle
Club Keno Drawings
Gabrielle Enright Weight Loss
House Of Budz Michigan
Scottsboro Daily Sentinel Obituaries
Stanley Steemer Johnson City Tn
Linda Sublette Actress
Gary Lezak Annual Salary
Top 25 E-Commerce Companies Using FedEx
2020 Can-Am DS 90 X Vs 2020 Honda TRX90X: By the Numbers
Craigslist en Santa Cruz, California: Tu Guía Definitiva para Comprar, Vender e Intercambiar - First Republic Craigslist
Tableaux, mobilier et objets d'art
Craigslist Antique
Dlnet Deltanet
Mit diesen geheimen Codes verständigen sich Crew-Mitglieder
Myapps Tesla Ultipro Sign In
18443168434
The Goshen News Obituary
Runelite Ground Markers
Prologistix Ein Number
Tamilyogi Cc
Inside the Bestselling Medical Mystery 'Hidden Valley Road'
4015 Ballinger Rd Martinsville In 46151
Blippi Park Carlsbad
Latest Posts
Article information

Author: Msgr. Refugio Daniel

Last Updated:

Views: 6055

Rating: 4.3 / 5 (74 voted)

Reviews: 89% of readers found this page helpful

Author information

Name: Msgr. Refugio Daniel

Birthday: 1999-09-15

Address: 8416 Beatty Center, Derekfort, VA 72092-0500

Phone: +6838967160603

Job: Mining Executive

Hobby: Woodworking, Knitting, Fishing, Coffee roasting, Kayaking, Horseback riding, Kite flying

Introduction: My name is Msgr. Refugio Daniel, I am a fine, precious, encouraging, calm, glamorous, vivacious, friendly person who loves writing and wants to share my knowledge and understanding with you.