Link to home
Start Free TrialLog in
Avatar of Steve Lowry
Steve LowryFlag for United States of America

asked on

Add Shortcut Key to New Macro in Excel Add-In

I have an Excel Add-In that has a macro which can be started using a shortcut key.  I have added another module in the add-in, copied the existing macro, and modified it to perform a different function.  How do I add a shortcut key to this new macro that is different from the one used for the original macro.
Avatar of byundt
byundt
Flag of United States of America image

You set the shortcut key combination starting with the ALT (Option) + F8 macro selector dialog. Select the new macro and click the Option... button. You set the shortcut key combination in the resulting dialog. 
Avatar of Steve Lowry

ASKER

I am familiar with that functionality.  The problem is that the macro is located in a module in an add-in, and it does not appear in that dialog box.  Is the same functionality in the VB Editor?
Is the add-in an xlam file that operates from a worksheet, or is it a dll file that operates in Visual Basic?
Hi Martin.  The add-in is an xlam file.
I believe that you can use a different approach. Put your macros in your Personal.xlsb file and then create new ribbon buttons for them. Once you've done that, the new buttons should show up in any workbook you open.
I forgot to mention that multiple people use this add-in.  I have rethought my approach to myself and others utilizing the two separate macros that are in the add-in.

However, I would still like to learn how to change or add shortcut keys for macros in that add-in.

Is this a possible solution to my problem?
  • Convert the xlam file to a xlsm file.
  • Use the Alt+F8 function to add/change the shortcut key in each macro.
  • Convert the xlam file back to an add-in.
Is this a possible solution to my problem?
Try it, but make a backup copy of the xlam file.
Martin, byundt,

I have changed my approach to solving my issue.  Do either of you have info on how to change or add shortcut keys for macros in an add-in?

Thanks.
Steve
ASKER CERTIFIED SOLUTION
Avatar of Martin Liss
Martin Liss
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thanks for your help on this question.  Stay safe.
Steve
You too.

You’re welcome and I’m glad I was able to help.

If you expand the “Full Biography" section of my profile you’ll find links to some articles I’ve written that may interest you.

Marty - Microsoft MVP 2009 to 2017
              Experts Exchange Most Valuable Expert (MVE) 2015, 2017
              Experts Exchange Top Expert Visual Basic Classic 2012 to 2019
              Experts Exchange Top Expert VBA 2018, 2019
              Experts Exchange Distinguished Expert in Excel 2018