Excel VBA to list key bindings (OnKey ?)

后端 未结 2 1858
礼貌的吻别
礼貌的吻别 2021-01-12 17:32

I am working with a large set of Excel vba scripts and some of them are bound to Ctrl-key combinations.

I know how to set one at a time in the user interface for Exc

2条回答
  •  执笔经年
    2021-01-12 17:51

    After searching for a while, I could not find any possibility to programmatically get a list of all key bindings.

    However, if you basically want to find out, which procedure runs on a shortcut, but you're not sure and don't want to crawl through your Personal Workbook, Add-ins, etc., you can create a dynamic breakpoint that will always stop on the first line of VBA code executed. To do this, simple use the Add Watch dialog (right click somewhere in the code window) enter the following parameters:

    Expression: Timer, Procedure: All Module: All, Watch Type: Break when value changes

    Then, simply execute the shortcut you're interested in - and the VBE will show you the routine that is bound to it...

提交回复
热议问题