Debugging your code is an important part of working with Excel Macros. Although there are ways to use the debugging features through the Visual Basic Editor menu options, you may find these keyboard shortcuts to be a much more efficient way to debug your code.
What to Press |
What It Does |
F5 |
Runs the current procedure or continues after pausing. |
Ctrl+Break |
Halts the currently running procedure. |
F8 |
Goes into debug mode and executes one line at a time. |
Ctrl+F8 |
Executes code up until the cursor. |
Shift+F8 |
Steps over the current line while in debug mode. |
F9 |
Toggles a breakpoint for the currently selected line. |
Ctrl+Shift+F9 |
Clears all breakpoints. |
Alt+D+L |
Compiles the current Visual Basic project. |