How to Permanently Add Macros in Excel Ribbon?

Having macros that automate custom tasks in Excel can be huge time savers. Like any tool, it would be ideal to have these macros easily accessible so we can run them any time we need them.

We often add buttons (like radio buttons) in specific worksheets to run our macros. However, finding the button to run the macro would be too burdensome if you have loads of worksheets in your workbook.

This is why setting up our macro button in the Excel Ribbon is a good idea. Whatever sheet we may be on, we can always run the macro with just a few clicks.

Also, if you have macros that you want to be available in other workbooks as well, you can do so when you add them to the Excel Ribbon.

Steps to Permanently Add Macros in Excel Ribbon

Example of what the Excel Ribbon looks like with custom macros.

Step #1: Add the Macros to the Personal Macro Workbook

A Personal Macro Workbook is a special workbook that runs in the background whenever we open the Excel app.

We will use this workbook to store the macros that we have created. This way, the macros are still accessible even when we open a different Excel file.

To create a personal macro workbook:

1. Go to the Developer tab and click the Record Macro button.

Go to the Developer tab and click the Record Macro button.

2. The Record Macro menu will appear.

Click the “Store macro in” dropdown list. Select Personal Macro Workbook. After that, click OK.

From the “Store macro in” dropdown list, select Personal Macro Workbook and click OK.

Excel will then proceed with recording whatever you do in the file and create its corresponding macro.

I’m assuming that you already have your macros ready, so all you need to do next is stop the recording by clicking the Stop Record button (just below the first worksheet).

Button to click to stop macro recording.

(However, if you need to record a macro, please proceed with performing the steps you wish to be automated in the workbook and then click on the stop button once done.)

3. Once you click the Stop Recording button, the Personal Macro Workbook should now be created.

To verify this, press ALT + F11 to open the VBA Editor.

On the list of projects, you should see PERSONAL.XLSB.

How to check if the Personal Macro Workbook is created.

If you did some steps while the Record Macro is turned on, you should see the macro recorded on Module1 of this file.

Example of a macro recorded in PERSONAL.XLSB.

4. Highlight the entire code in this module and delete it (if needed).

Then, add the code of your macros there.

Add the code of your macros in Module1 of Personal.XLSB.

That’s it! Your Personal Macro Workbook should now all be set up.

Step #2: Customize the Excel Ribbon

Now, it’s time to add the button(s) in the Excel Ribbon.

(Note: If you prefer adding a button in the Quick Access Toolbar, you can proceed to the next section of this article.)

1. Right-click anywhere on the Excel Ribbon.

2. A pop-up menu will appear. Select Customize the Ribbon.

Steps to customize Excel Ribbon.

3. In the Excel Options menu, click the New Tab button.

Steps to insert new tab to the ribbon.

The new tab will then be inserted in the list of Main Tabs.

4. Right-click on the new tab and select Rename.

Steps to rename the new tab added to the ribbon.

5. Enter your desired tab name.

Enter your desired tab name in the menu that appears.

In my example above, I’ve named it “Macros”.

6. Next, let’s rename the group under the current tab.

Right-click on New Group (Custom) and select Rename.

Steps to rename a group in the ribbon.

Type the appropriate name for the group.

In the menu that appears, type the new group name and click OK.

In my example above, I’ve named the group “Worksheet” because the macros that I will add to it are worksheet-related functions.

If you have multiple macros to add, you can add more groups so you can group related macros.  

To do this, just click the New Group button at the bottom.

Steps to add more groups to one of the tabs in the Excel Ribbon.

The new group will then be added to the current tab.

Don’t forget to give it a new name by right-clicking on it and selecting Rename.

7. After adding all the groups, it’s now time to add the macro buttons.

Steps to add macro buttons to each group.

  1. Click the first group you would like to add buttons to.
  2. Click the “Choose commands from” dropdown list. From the list of options, select Macros.
  3. You should see the macros added in the PERSONALXLSB file. Select the first macro you would like to add to the group.
  4. Once selected, click the Add >> button.

Repeat these steps until you’ve added all macros to their appropriate group.

Sample output after adding macros to each group.

8. Next, let’s rename each of the macros to specify how they will appear on the buttons.

Steps to change the display name and icon of each macro.

  1. Right-click on the macro and select Rename.
  2. Choose the symbol or the image that you’d like to appear on the button.
  3. Edit the Display Name.
  4. Once done, click OK.

Repeat these steps until you’ve renamed all your macros and added their corresponding symbols.

9. You can re-arrange the order of the macros, the groups, and the tabs.

You just need to select the object (whether it’s the macro, group, or tab) and click the up or down arrow on the right side.

Buttons to click to re-order the macros in the Excel Ribbon.

10. If you’re happy with the names and the arrangement of the tab, click the OK button.

And that’s it! You have successfully added your macro(s) to the Excel ribbon.

Example of what the Excel Ribbon looks like with custom macros.

You can click on these macro buttons to test them.

Also, try closing the current file. Then open a new one and see if you still have the macro buttons visible in the Excel Ribbon.

You can also add a custom autofill list after creating your customized Excel ribbon.

ADDITIONAL TIPS

  • If you must update your macros and need to temporarily disable or hide the buttons from the Excel Ribbon, just uncheck the corresponding tab from the Customize Ribbon menu (as shown below).
Steps to hide the buttons from the Excel Ribbon.

  • To permanently remove them from the Excel Ribbon, right-click on the corresponding tab and select Remove.
Steps to permanently remove the macros added to the Excel Ribbon.

  • To reset all the changes made to the Excel Ribbon, just click Reset >> Reset All Customizations.
Steps to reset all customizations in the Excel Ribbon.

Permanently Add Macros in the Quick Access Toolbar

Aside from the Excel Ribbon, you can also permanently add the macros in the Quick Access Toolbar (QAT).

By default, the QAT is located just above the Excel Ribbon.

Screenshot of where the Quick Access Toolbar is typically located.

With the QAT, you can add the macros as icons on top. Users can readily access them without browsing through the tabs. You won’t, however, see the names of each function unless you hover the mouse over each icon.

To add your macros to this toolbar, do the following:

1. Add the macros to the Personal Macro Workbook (same steps as above).

2. Click the Customize Quick Access Toolbar button (see the last icon in the QAT).

Steps to customize the Quick Access Toolbar.

A pop-up menu will show up. Select More Commands.

3. You’ll then be redirected to the Excel Options for Quick Access Toolbar.

Steps to add the macro to the Quick Access Toolbar.

  1. In the “Choose commands from” dropdown list, select Macros.
  2. From the list of macros that appear, select the macro you want to add to the QAT.
  3. Click the Add >> button.
  4. You should now see your selected macro in the list of QAT functions.

4. Next, we’ll modify the macro to change its display name and icon.

Steps to modify the display name and icon of the command added to the Quick Access Toolbar.

  1. Select the macro from the list of QAT commands.
  2. Click the Modify button.
  3. Select the icon that you’d like to appear in the QAT.
  4. Edit the display name.
  5. Once done, click OK.

5. You should now see the updated name and icon for your macro. If you’re happy with it, click OK.

Example of what happens once the Quick Access Toolbar command's name and icon are changed.

6. That’s it! You should now see your macro added to the QAT.

Example of a Quick Access Toolbar with the macro added.

Conclusion

If you want your macros to be accessible from any Excel workbook that you open, you need to add them to the Excel Ribbon (or the Quick Access Toolbar) as described in the steps above. Remember to add the macros to the Personal Macro Workbook – this is the only way the macros can run from any Excel file on your computer.

Leave a Comment