excel VBA break execution when there's no break key on keyboard

前端 未结 12 1697
耶瑟儿~
耶瑟儿~ 2021-01-01 11:42

I\'m just noticing that on my laptop (Dell XPS 15z) there\'s no BREAK key (no dedicated number keypad). I\'m running the debugger step-by-step and then when all seems fine,

相关标签:
12条回答
  • 2021-01-01 12:13

    I have a Dell Precision without a Pause/Break key but there is a replacement for that: Fn + B, so:

    - Fn + B == Pause (pause execution);
    - Ctrl + Fn + B == Break (break execution);
    - Win + Fn + B == Windows + Pause (open System properties).

    You can execute the command:

    dir /s C:\
    

    and test the Pause and Break combination keys while dir lists all files in drive C.

    reference

    0 讨论(0)
  • 2021-01-01 12:22

    I have an HP laptop and this works when I want to break after a msgbox, hold fn+ctrl and click right shift key (has pause on it as well) then respond to msgbox and code will break.

    0 讨论(0)
  • 2021-01-01 12:22

    I found a way round this, opened another instance of Excel and another spreadsheet, then opened the VBA editor from there and it showed as "running" so I could click the stop button

    0 讨论(0)
  • 2021-01-01 12:28

    Hold CTRL+Fn & hit Shift - Stopped my macro from running. I don't have a 'Break' key either on the keyboard of my HP Pavilion G7.

    0 讨论(0)
  • 2021-01-01 12:28

    I found this thread and saw the solution that has the most votes, but then realized my laptop has no Pause, Break or ScrLk) keys. I tried other proposed solutions, like 'OnScreen Keyboard' or alternative key combinations, but those didn't work either.

    Then it hit me: if it's a phantom break point associated with particular line(s) of code, why not just get rid of the line(s)?

    So that's what I did:

    1. I cut the line(s) where execution was breaking.
    2. Ran the macro again (it didn't break this time)
    3. Pasted the line(s) again.

    It worked for me, when no other key combination (onscreen or physical) worked. Hope it helps someone!

    0 讨论(0)
  • 2021-01-01 12:29

    Ctrl + Fn + B works for Excel 365 (Office 365) on my Dell Latitude 5480 (no Break key).

    0 讨论(0)
提交回复
热议问题