Excel like a finance pro.
← The libraryPractice · 2 questions →
VBA · Errors & debugging
Breakpoints and stepping
Pause code at a line (F9) and run it one line at a time (F8) while watching variables.
Very commonDifficulty 1050 · Capable
When to use it
A breakpoint (F9 on a line) pauses the macro there. F8 then runs one line at a time while you hover over variables to see values. This is how VBA gets debugged.
The code
- Code
F9 toggles a breakpoint, F8 steps, F5 continues
Worked examples
Pause
Click a line, press F9, run the macro → Execution pauses at the line
Then hover variables.
Step
F8 repeatedly → One line at a time; Shift + F8 steps over a call
Follow the logic.
Continue
F5 → Continues to the next breakpoint or the end
Resume.
Worth knowing
- Ctrl + F9 sets the next statement to run, skipping or repeating lines.
- Breakpoints are not saved with the file; Stop statements are.
- Debug > Clear All Breakpoints resets.
Where it goes wrong
- A forgotten Stop statement halts the macro for users.
- Stepping through Application.ScreenUpdating = False leaves the screen frozen until restored.
Related
Learn the moves here — or let Wauvel run them on your numbers.
Meet your AI CFO →One CFO-grade Excel tip a week
A short, practical email for finance operators — functions, shortcuts, and the moves that save an afternoon. Free, unsubscribe anytime.