3 Easy Methods to Create Button in Excel for Macros (2024)

Do you repeat various Excel actions like copy & pasting data, formatting, putting borders, etc?

Do you know that you create button in Excel and automate your tasks in Excel with a couple of mouse clicks?

If you keep on repeating the same thing over and over again,creating anExcel Macrois perfect for you! It saves you time so you can do things that you like doing, like going home early 🙂

Click a button and all your tasks are done for you!

I will show you 3 different ways using which you can enable the Macro Creation and create button in Excel!

Watch our free training video on How to Create Your First Macro Button in Excel

Table of Contents

  • Using ActiveX Control Buttons
  • Using Shapes
  • Add to Quick Access Toolbar

Follow a step-by-step tutorial on how to create a button in Excel and download this Excel workbook to follow along:

DOWNLOAD EXCEL WORKBOOK

Using ActiveX Control Buttons

Running a macro can sometimes be a tedious task. The fastest way to run a macro will be to assign a macro to a button. You can use ActiveX controls to create button in Excel.

STEP 1: Right-click anywhere on your Ribbon and selectCustomize the Ribbon:

STEP 2:Make sure theCustomize Ribbonis selected.

Then select theDeveloperoption underMain Tabs.

ClickOK.

STEP 3:Now go toDeveloper > Insert > ActiveX Controls > Button

Drag anywhere in the Excel spreadsheet to create button in Excel.

See also Understanding the VBA MsgBox Function: A Comprehensive Guide

STEP 4: Right-click on your new button and selectView Code.

STEP 5:Type in this code:Range(“A6”).Value = “Hello”

What this will do is toset the value of cell A6 toHello.

STEP 6:Time to test it out! Make sureDesign Mode is deselected.

STEP 7:Click on the button now and you will seeHellopop up on your screen!

In this way, you can create button in Excel and assign a macro to it. Using VBA codes, you can also assign a different task for a different trigger like double-click single-click, right-click, etc.

You can even change the formatting of this button by right-clicking on the button and selecting the option Format Control.

But the only issue with this method is that the size of the button may change when you make changes to the worksheet or share it with someone else.

Using Shapes

Shapes provide you the flexibility to format and customize the appearance of the buttons on your Excel spreadsheet.

You can use different shapes, icons, WordArt images, and objects as per the theme of your worksheet. The formatting will also remain consistent using this method.

In my opinion, this is the simplest and most adaptable option to create button in Excel and run a macro.

Let’s look at a detailed tutorial on how we can go about this:

STEP 1: Go to Insert Tab > Select Illustrations > Under shapes dropdown > Select rectangle shape.

STEP 2:Right-click the shape and select Edit Text to add text to the button.

Or, you can double click on the button to edit text.

STEP 3: Provide a name to this button – Highlight Max Value.

STEP 4: Go to Developer >Visual Basic.

STEP 5: Type the following code in the module.

Copy Source Code:

<em>Sub HighlightMaxValue()</em><em>Dim cell As Range</em><em>For Each cell In Selection</em><em>'If it matches the highest value, then change the style to be Note</em><em>If cell = WorksheetFunction.Max(Selection) Then</em><em>cell.Style = "Note"</em><em>End If</em><em>Next cell</em><em>End Sub</em>

HighlightMaxValue will now be saved!

STEP 6: You can easily add a macro to this button by right-clicking on the button and select Assign Macro.

STEP 7: In the Assign Macro dialog box, you can select one macro (here, HighlightMaxValue) from the list saved in the Excel Workbook. Click OK.

This HighlightMaxValue will highlight the cell with maximum value with yellow color.

STEP 8: Select the range and then press the Excel Macro button.

STEP 9: Select the maximum value from the range i.e. 947 will be highlighted.

This is how you can easily use shapes to create button in Excel and assign a macro to it.

See also How to Insert Multiple Rows Using Macros in Excel

You can also customize these buttons by following the steps below:

  • Hold the Ctrl key and click on the button.
  • Go to Shape Format Tab
  • Select an appropriate option from the list – shape fill, shape outline, shape effects, text fill, text outline, text effects, size, etc.

To provide the button a 3-D effect – Go to Shape Format > Shape Effects > Bevel > Round.

This is how your 3-D Excel Macro button will look like:

You can also prevent these buttons from changing their size when you change the size of a column or row.

  • Right-click on the button and select Size and Properties.
  • In the Format Shape dialog box, go to Properties and select Don’t move or size with cells.

Now, even if you change the size of the rows or columns, the button will remain intact.

Add to Quick Access Toolbar

You can easily add a macro as a button on the Quick Access Toolbar and use it on any of the sheets present in the workbook.

STEP 1: Right-click on the arrow next to the Quick Access Toolbar and select More Commands.

STEP 2: In the Choose commands fromlist, selectMacros.

STEP 3: Select HighlightMaxValue from the list and click on Add>>.

STEP 4: Click on Modify to change the symbol of this macro.

See also Microsoft Excel Online Course Private Access - 20+ Hours Beginner to Advanced Course

STEP 5: Select an appropriate symbol and click OK.

STEP 6: Click OK.

Your Quick Access Toolbar will now contain the macro – HighlightMaxValue. Simply, click on this icon and your macro will run!

Further Learning:

  • 3 Easy Methods to Create Button in Excel for Macros
  • 101 Excel Macros Examples
  • Reverse Text Function Using Macros In Excel

Make sure to download our FREE PDF on the 333 Excel keyboard Shortcuts here:

3 Easy Methods to Create Button in Excel for Macros (32)

You can learn more about how to use Excel by viewing our FREE Excel webinar training on Formulas, Pivot Tables, Power Query, and !

Post Views: 36,987

3 Easy Methods to Create Button in Excel for Macros (34)

Bryan

Bryan is a best-selling book author of the 101 Excel Series paperback books.

3 Easy Methods to Create Button in Excel for Macros (2024)

FAQs

What is the easiest way to create a macro? ›

Record a macro with a button
  1. Click View > Macros > Record Macro.
  2. Type a name for the macro.
  3. To use this macro in any new documents you make, be sure the Store macro in box says All Documents (Normal. ...
  4. To run your macro when you click a button, click Button.
  5. Click the new macro (it's named something like Normal.

How many methods are there to run a macro in Excel? ›

Working with recorded macros in Excel
TaskDescription
Run a macroThere are several different ways you can run a macro, such as using a shortcut key, graphic object, Quick Access Toolbar, a button, or even when opening a workbook.
Edit a macroYou use the Visual Basic Editor to edit the macros attached to a workbook.
8 more rows

What are button macros? ›

The Button macro allows you to create stylized buttons which provide hyperlinks to other pages or websites. These can be added individually anywhere on a page or grouped as a horizontal row of button links using the Button Group macro.

How to create macros in Excel with examples? ›

How to create a macro in Excel
  1. Open the Developer tab. Click on the "Developer" tab at the top of the program to access the developer options. ...
  2. Choose to record a macro. ...
  3. Provide macro details. ...
  4. Perform your chosen actions. ...
  5. Complete your macro and stop recording. ...
  6. Use your shortcut.
Feb 3, 2023

How to insert a button in Excel without a macro? ›

Here are the steps to create a button in Excel using Excel Shapes:
  1. Click on the Insert tab and then click on Shapes.
  2. Select the preferred shape of your button (we selected a rounded rectangle).
  3. Drag and drop the selected shape to the preferred location on the worksheet to set the size of the shape.

What is the easiest way to plan macros? ›

A basic strategy would be to divide your total daily targets including calories, carbs, fat and protein by four. This would give you even macro targets for breakfast, lunch, dinner and snacks. Then, divide that 1/4 number by two to get the target macros for your two snacks.

What is the easiest way to explain macros? ›

"Macros" is short for macronutrients, a term used to describe the nutrients your body needs in large amounts, specifically carbohydrates, fat and protein. "Macronutrients are basically what your body runs on," Albert says. "You want your diet to have a balance of carbs, fat and protein."

In which ways can a macro be created? ›

To create a macro, you can record the actions that you want to automate in Excel. Once the Developer tab is visible, you can either click on the 'Record Macro' button in this tab or a button that appears in the lower left-hand corner of your screen and contains a spreadsheet icon with a red dot.

How to make a shortcut button in Excel? ›

1. Add a Button to the Quick Access Toolbar
  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.
  4. Click “Add >>” and “Save.”

How to create a macro button in Excel? ›

How to create a macro button in Excel
  1. On the Developer tab, in the Controls group, click Insert, and select Button under From Controls.
  2. Click anywhere in the worksheet. ...
  3. Select the macro you'd like to assign to the button and click on OK.
  4. A button gets inserted in the worksheet.
Mar 14, 2023

Which button control is used to run Macros in Excel? ›

Pressing F8 will let you step through the macro code one line at a time. Edit - This will open the Visual Basic Editor and let you edit the macro code as needed. Once you've made changes, you can press F5 to run the macro from the editor.

How do I assign a macro to a mouse button? ›

More Information
  1. Click Start, and then click Control Panel. ...
  2. Double-click Mouse.
  3. Click the Buttons tab.
  4. Under Button Assignment, click the box for a button to which you want to assign a function, and then click the function that you want to assign to that button. ...
  5. Click Apply, and then click OK.
  6. Close Control Panel.

Top Articles
Chrome VPS, VPS with Google Chrome Browser
Companies With Little or No Debt
Dew Acuity
Davante Adams Wikipedia
Is Sportsurge Safe and Legal in 2024? Any Alternatives?
What's Wrong with the Chevrolet Tahoe?
Craigslist Phoenix Cars By Owner Only
Best Pawn Shops Near Me
Bjork & Zhulkie Funeral Home Obituaries
Dc Gas Login
Daily Voice Tarrytown
Abortion Bans Have Delayed Emergency Medical Care. In Georgia, Experts Say This Mother’s Death Was Preventable.
Driving Directions To Bed Bath & Beyond
Khiara Keating: Manchester City and England goalkeeper convinced WSL silverware is on the horizon
Marvon McCray Update: Did He Pass Away Or Is He Still Alive?
Metro Pcs.near Me
Nhl Tankathon Mock Draft
Epguides Strange New Worlds
Samantha Aufderheide
Adt Residential Sales Representative Salary
Clare Briggs Guzman
eugene bicycles - craigslist
Kirk Franklin Mother Debra Jones Age
Violent Night Showtimes Near Johnstown Movieplex
91 Octane Gas Prices Near Me
How Do Netspend Cards Work?
Ark Unlock All Skins Command
11 Pm Pst
Dmitri Wartranslated
Deshuesadero El Pulpo
Author's Purpose And Viewpoint In The Dark Game Part 3
Vindy.com Obituaries
Directions To Cvs Pharmacy
At Home Hourly Pay
Bill Manser Net Worth
Academic Calendar / Academics / Home
30 Years Of Adonis Eng Sub
St Vrain Schoology
Tlc Africa Deaths 2021
Phmc.myloancare.com
Huntsville Body Rubs
Access to Delta Websites for Retirees
Caesars Rewards Loyalty Program Review [Previously Total Rewards]
Benjamin Franklin - Printer, Junto, Experiments on Electricity
Union Supply Direct Wisconsin
All Buttons In Blox Fruits
Suppress Spell Damage Poe
R Detroit Lions
Sams La Habra Gas Price
O'reilly's Eastman Georgia
Https://Eaxcis.allstate.com
Noaa Duluth Mn
Latest Posts
Article information

Author: Duncan Muller

Last Updated:

Views: 6048

Rating: 4.9 / 5 (59 voted)

Reviews: 90% of readers found this page helpful

Author information

Name: Duncan Muller

Birthday: 1997-01-13

Address: Apt. 505 914 Phillip Crossroad, O'Konborough, NV 62411

Phone: +8555305800947

Job: Construction Agent

Hobby: Shopping, Table tennis, Snowboarding, Rafting, Motor sports, Homebrewing, Taxidermy

Introduction: My name is Duncan Muller, I am a enchanting, good, gentle, modern, tasty, nice, elegant person who loves writing and wants to share my knowledge and understanding with you.