Set and clear a breakpoint
You set a breakpoint to suspend execution at a specific statement in a procedure; for example, where you suspect problems may exist. You clear breakpoints when you no longer need them to stop execution.
To set a breakpoint
Position the insertion point anywhere in a line of the procedure where you want execution to halt.
On the Debug menu, choose Toggle Breakpoint (F9), click next to the statement in the Margin Indicator Bar (if visible), or use the toolbar shortcut:
.
The breakpoint is added and the line is set to the breakpoint color defined on the Editor Format tab in the Options dialog box.
If you set a breakpoint on a line that contains several statements separated by colons (:), the break always occurs at the first statement on the line.
To clear a breakpoint
Position the insertion point anywhere on a line of the procedure containing the breakpoint.
From the Debug menu, choose Toggle Breakpoint (F9), or click next to the statement in the Margin Indicator Bar (if visible).
The breakpoint is cleared and highlighting is removed.
To clear all breakpoints in the application
- From the Debug menu, choose Clear All Breakpoints (CTRL+SHIFT+F9).
Note
Breakpoints set in code are not saved when you save your code.
See also
Support and feedback
Have questions or feedback about Office VBA or this documentation? Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.
피드백
https://aka.ms/ContentUserFeedback
출시 예정: 2024년 내내 콘텐츠에 대한 피드백 메커니즘으로 GitHub 문제를 단계적으로 폐지하고 이를 새로운 피드백 시스템으로 바꿀 예정입니다. 자세한 내용은 다음을 참조하세요.다음에 대한 사용자 의견 제출 및 보기