2 Ways to Assign Keyboard Shortcuts to Macros in Excel




About this tutorial:

Video duration: 00:13:41
In this video I explain 2 ways to create keyboard shortcuts to run macros in Excel. Assigning shortcut keys to macros in your Personal Macro Workbook allows you to run the macros on any open file.

Download the sample Excel file here:

The first way is using the Macro Options window. This can be accessed from Excel, and is easy to setup.

The second way is using VBA code and the Application.OnKey method. This method requires a bit more setup work, but does have some distinct advantages.

Which method is better? Watch the…

Post Author: OfficeTutes.com

Apple lover, ICT and LEAN consultant, MS Office lecturer My other website with video tutorials - Tutorials, guides and news for iPhones and iPads

13 thoughts on “2 Ways to Assign Keyboard Shortcuts to Macros in Excel

    Khuram Shahzad

    (June 6, 2020 - 6:05 pm)

    Hi
    Thank you for sharing useful stuff.
    It works fine with any workbook but does not work on custom ribbon control I have designed using xml ui editor. Shows an error "Argument not optional" since I have assigned the same macro control to a button on the ribbon.
    Need your thoughts please.
    Thanks

    Said Elnaffar

    (June 6, 2020 - 6:05 pm)

    CAVEAT:
    Use the Activate/Deactivat instead if you want to override the already defined shortcuts of Excel, otherwise, the above Open/BeforeClose won’t work – I grappled with this problem for a few days before I reach the solution!

    the white in the hidden Shadows

    (June 6, 2020 - 6:05 pm)

    Is there a way so if I press certain buttons, a series of steps will happen in a certain computer program. When researching, we were using gel electrophoresis and the program we used to analyze it in the computer had many steps and it would be easier to write a program. It would be amazing if we can do it so that the shortcut runs the gel, analyze it, print a copy, and email to yourself.

    Washeyyy

    (June 6, 2020 - 6:05 pm)

    Tq sir

    Joe M

    (June 6, 2020 - 6:05 pm)

    Thank-you for the video. I prefer to use the workbook activate and deactivate events vs. open and before close.

    Katerina

    (June 6, 2020 - 6:05 pm)

    Thank you John, great informative video

    Ahmed Al-Dossary

    (June 6, 2020 - 6:05 pm)

    Imressive tutorial on shortcut for your favorite macros 👍🏻

    Thanks for taking the time…

    Bangla Tech HotSpot

    (June 6, 2020 - 6:05 pm)

    nice sir

    Md.Saiful Islam Tuku

    (June 6, 2020 - 6:05 pm)

    ok thanks

    Wayne Edmondson

    (June 6, 2020 - 6:05 pm)

    Hi Jon.. excellent video and summary of the two methods of creating macro shortcut keys. I've always been frustrated by the limited choices in the options window. OnKey is the way to go. Thanks for sharing your tips. Thumbs up!

    Alex Lev

    (June 6, 2020 - 6:05 pm)

    Hi, Jon! How did you change interface of your Excel? I have Office 365 and it looks different

    Clay T. Enos

    (June 6, 2020 - 6:05 pm)

    Excellent explanation, and I like how you use the workbook events to toggle macro shortcuts on and off.

    Don Lesser

    (June 6, 2020 - 6:05 pm)

    Very useful. Very helpful. Thanks.

Leave a Reply

Your email address will not be published. Required fields are marked *