Assign keyboard shortcut to run procedure

前端 未结 9 2095
没有蜡笔的小新
没有蜡笔的小新 2020-11-29 04:35

When I press F5 in the VBA editor I would always like to run my \"Sub Skynet()\" procedure. Is there any way to assign a keyboard shortcut to this procedure.

9条回答
  •  忘掉有多难
    2020-11-29 05:08

    I ran into this problem myself. The only solution I have is to record the macro in an excel workbook first. Then, drag and drop THE MODULE from the open workbook into the add-in modules. This will be a copy of the above module, but the keyboard shortcut you assigned to it will thankfully persist.

    I just record a garbage macro and move it in there, then copy the code from my real module afterwords.

    Felt so great to figure this out, I felt like I had to reply to the 5 year old posts I found on the subject!!!

提交回复
热议问题