Search

How to add a Macro to Excel Ribbon

Macros are user created (written or recorded) programs which are used to automate repeated & complex tasks in Excel. Macros feature is available in various Microsoft Office Applications.

Macros can be stored within the Excel file with .xlsm extension. Macros are not allowed to store inside an Excel .xlsx extension file because of security reasons.

Macros are written in VBA (Visual Basic for Applications). VBA (Visual Basic for Applications) is language similar to Microsoft Visual Basic programming language and VB Script language.

To add a Macro to Excel Ribbon, follow these steps.

Step 1 - Right-click anywhere on Excel Ribbon and then select "Customize the Ribbon", as shown in below image.

Open Excel Options add Macro to Ribbon

"Excel Options" window to customize Excel Ribbon will be displayed as shown below.

Excel Options Window

Tip

"Excel Options" window to customize Excel Ribbon can be opened by following methods also.

• Click the "File" tab in Excel Ribbon and then click "Options". Select "Customize Ribbon" Panel.

Or

• Right-click anywhere on the "Quick Access Toolbar" (except on "Customize Quick Access Toolbar" drop-down button). Click "Customize Ribbon".

Step 2 - Click on "Choose Commands from" drop-down list and select "Macros", as shown in below image.

Click on Choose Commands from drop-down list and select Macros

 

Step 3 - Select the Macro you need to add to Excel Ribbon from left-side list. Select the Group from right-side list where you want to add the Macro (In this example, the selected Group is OmniSecuGroup (Custom)). Click "Add" button to add the Macro to the selected Group. Click "OK" button to finish adding Macro to Ribbon, as shown in below image.

Add Macro to Excel Ribbon

Please note that no Macro will be displayed in left-side list until

1) Atleast a Macro is available (written or recorded) in the Excel workbook you are currently working with

Or

2) A Macro is available in any other Excel workbook which is currently open.

Selected Macro is added to a Group inside a Tab in Excel Ribbon, as shown in below image.

Add Macro to right-side list

Now you may click the Macro icon from Excel Ribbon to run the Macro. Here in this example, the output of Macro is just a welcome message box, as shown below. In real-time, you may create and add very complex Macros to Excel Ribbon. You can run your favourite macros easily from Excel Ribbon, just by a single click.

Excel Ribbon Macro Output

Related Tutorials
• Excel Ribbon explained in detail
• Responsive Nature of Excel Ribbon
• Different types of Buttons in Excel Ribbon
• How to collapse Excel Ribbon
• How to Customize Excel Ribbon
• How to create and add a Custom Tab in Excel Ribbon
• How to create and add Custom Group in Excel Ribbon's Tab
• How to add a Command button to Excel Ribbon's Group
• How to reset Excel Ribbon customizations
• How to Import/Export Excel Ribbon Customizations
• How to change default Macro button icon in Excel Ribbon
• How to change the position of Tab on Excel Ribbon
• How to change the position of Group on Excel Ribbon's Tab
• How to change the position of Command button in Excel Ribbon's Group
• What is Excel Ribbon Contextual Tab, Excel Ribbon Tool Tab
• Excel Formula Bar explained in detail
• Excel Status Bar in brief
• Excel Status Bar explained in detail
• Excel Quick Access Toolbar (QAT)
• Excel Backstage View
• Excel Options Dialog Box Window