Assign keyboard shortcut to run procedure

前端 未结 9 2079
没有蜡笔的小新
没有蜡笔的小新 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:07

    Write a vba proc like:

    Sub E_1()
        Call sndPlaySound32(ThisWorkbook.Path & "\e1.wav", 0)
        Range("AG" & (ActiveCell.Row)).Select 'go to column AG in the same row
    End Sub
    

    then go to developer tab, macros, select the macro, click options, then add a shortcut letter or button.

提交回复
热议问题