Create Custom Excel Shortcuts (2 Ways)
by Avantix Learning Team | Updated March 24, 2021
Applies to: Microsoft® Excel® 2013, 2016, 2019 and 365 (Windows)
Microsoft Excel has many built-in shortcuts as well as the ability to navigate and select in the Ribbon using the keyboard. However, you may also want to write your own keyboard shortcuts for specific commands.
Unfortunately, Excel doesn't offer a keyboard assignments command similar to the one available in Microsoft Word. In Word, you can assign keyboard shortcuts through the Options command on the File tab. In the Customize Ribbon category, there is a Keyboard Shortcuts Customize button that is not available in Excel.
Recommended article: 10 Excel Data Entry Tricks and Shortcuts Every User Should Know
Do you want to learn more about Excel? Check out our virtual classroom or live classroom Excel courses >
So, you have a couple of options in Excel. You can add buttons to the Quick Access toolbar (which are automatically assigned Alt shortcuts) or you can write a macro using the Macro Recorder.
1. Creating a keyboard shortcut by customizing the Quick Access Toolbar
To customize the Quick Access Toolbar and create keyboard shortcuts:
- Click the File tab in the Ribbon and then click on Options.
- Click the Quick Access Toolbar category on the left.
- From the drop-down menu under Choose commands from, select All Commands.
- Click the button you want to add.
- Click Add.
- Continue adding buttons.
- If you want to re-order buttons, click the button in the Customize Quick Access toolbar pane on the right and click the Move Up or Move Down arrow buttons.
- Click Close.
Commands appear in the Excel Options dialog box:
Once you have added the desired buttons, Excel assigns keyboard shortcuts automatically to the buttons based on the order in the Quick Access Toolbar. For example, the first button can be accessed by pressing Alt and then 1, the second button by pressing Alt and then 2 and so on.
2. Creating a macro with a keyboard shortcut using the Macro Recorder
You can also add a keyboard shortcut by recording a macro. In Excel, you can record a macro to automate specific actions and you can assign a keyboard shortcut to the macro. To keep things simple, we'll use the Record Macro button on the View tab in the Ribbon.
You'll be using the Record Macro dialog (below) to create keyboard shortcuts:
To create a macro and assign a keyboard shortcut:
- Open the file you want to use or create a new workbook.
- Click the View tab in the Ribbon.
- Click Macros and select Record Macro. A dialog box appears.
- Under Macro Name, name the macro (no more than 255 characters and do not include spaces or begin with a number or an underscore).
- Under Shortcut key, enter a keyboard shortcut. For example, type Shift + H (this would assign Control + Shift + H as the shortcut). By adding Shift, you are less likely to create the same shortcut as a built-in Excel shortcut.
- Under Store macro in, choose This Workbook, New Workbook or Personal Macro Workbook. For global shortcuts, save the macro in the Personal Macro Workbook which is launched on startup and is hidden by default. If you store a macro in another workbook, it will need to be open to run the macro.
- Under Description, you can enter a description.
- Click OK.
- Perform the actions you want to record. For example, click Paste on the Home tab, choose Paste Special and then click on Values in the dialog box. All of your actions are being recorded.
- Click the View tab, click on Macros and then select Stop Recording.
- Try pressing the keyboard shortcut combination that you assigned to run the macro.
When you use the Macro Recorder, Excel writes the code for the macro using VBA (Visual Basic for Applications). If a macro you created in the Personal Macro Workbook doesn't work as expected, you will probably want to delete it.
To delete a macro that is stored in the Personal Macro Workbook, you will need to unhide the workbook first. To unhide the Personal Macro Workbook, click Unhide on the View tab, click Personal and click OK. To delete a macro, click Macros on the View tab and choose View Macros. Click on the macro you want to delete and click Delete. Be sure to hide the Personal Macro Workbook again using Hide on the View tab.
If you have displayed the Developer tab in the Ribbon, Record Macro as well as other useful buttons appear in this tab as well.
Did you find this article helpful? If you would like to receive new articles, join our email list.
This article was first published on February 13, 2017 and has been updated for clarity and content.
Our instructor-led courses are delivered in virtual classroom format or at our downtown Toronto location at 18 King Street East, Suite 1400, Toronto, Ontario, Canada (some in-person classroom courses may also be delivered at an alternate downtown Toronto location). Contact us at email@example.com if you'd like to arrange custom instructor-led virtual classroom or onsite training on a date that's convenient for you.
Copyright 2024 Avantix® Learning
You may also like
There are several strategies to replace zero values (0) with blanks in Excel. If you want to replace zero values in cells with blanks, you can use the Replace command or write a formula to return blanks. However, if you simply want to display blanks instead of zeros, you have two formatting options – create a custom number format or a conditional format.
Power Query in Excel is a powerful data transformation tool that allows you to import data from many different sources and then extract, clean, and transform the data. You will then be able to load the data into Excel or Power BI and perform further data analysis. With Power Query (also known as Get & Transform), you can set up a query once and then refresh it when new data is added. Power Query can import and clean millions of rows of data.
You can freeze one or more rows in an Excel worksheet using the Freeze Panes command. If you freeze rows containing headings, the headings will appear when you scroll down. You can freeze columns as well so when you scroll to the right columns will be frozen.
Microsoft, the Microsoft logo, Microsoft Office and related Microsoft applications and logos are registered trademarks of Microsoft Corporation in Canada, US and other countries. All other trademarks are the property of the registered owners.
Avantix Learning |18 King Street East, Suite 1400, Toronto, Ontario, Canada M5C 1C4 | Contact us at firstname.lastname@example.org