VBA & Macro Problems

Fix Excel VBA F8 Debugging Runs Remaining Code Instead of Stepping

Adam DavisAdam Davis Oct 19, 2026 869 views

Question details

The F8 key stops stepping line-by-line and instead executes the remaining macro code while debugging in the VBA editor.

Fix Excel VBA F8 Debugging Runs Remaining Code Instead of Stepping
Product
Microsoft Excel
Device & OS
not provided
Scenario
Debugging a macro procedure using F8 to step through the VBA code line by line.
Observed behavior
After stepping through several lines successfully, pressing F8 suddenly causes the rest of the macro to run completely instead of staying in break mode.
Before you start

Save your current VBA project and Excel workbook to ensure you do not lose any unsaved code changes before restarting the application.

Solution 1Recommended

Save and Restart Microsoft Excel

The most effective and commonly proven fix for this VBE (Visual Basic Editor) glitch is to simply restart the Excel application.

This issue is often caused by a temporary memory glitch within the Visual Basic Editor. Clearing the application's active memory by performing a complete restart will typically restore the default F8 step-by-step debugging behavior.

1
Save VBA Code

Click the Save icon in the Visual Basic Editor or press Ctrl+S to save your current macro progress.

2
Close Editor and Workbooks

Close the Visual Basic Editor window, then save and close all active Excel workbooks.

3
Quit Excel

Completely exit Microsoft Excel. If necessary, open the Task Manager (Ctrl+Shift+Esc) to ensure no hidden Excel background processes are still running.

4
Reopen and Resume

Relaunch Excel, open your workbook, press Alt+F11 to open the VBA Editor, and press F8 to resume stepping through your code normally.

Save and Restart Microsoft Excel
Quick Fix: This temporary glitch in the VBA editor is almost always resolved by a fresh restart of the Excel application.
Free Microsoft Office alternative

Switch to WPS Office for a Stable and Lightweight Experience

If you are tired of unexpected glitches in Microsoft Office, WPS Office offers a free, lightweight, and highly compatible alternative. It provides a familiar user interface, making your transition seamless while supporting all major document, spreadsheet, and presentation formats.

Highly compatible with Microsoft Excel (.xlsx, .xls, .csv) formats.Lightweight installation with faster launch times and fewer background glitches.Familiar, easy-to-use interface that requires no steep learning curve.Built-in tabbed workspace to manage multiple spreadsheets in one window.
microsoft office alternative - wps office

Frequently Asked Questions

Why does the VBA editor stop stepping into my code?

This is often caused by a known glitch in the Visual Basic Editor's state memory, or when the code enters a continuous loop that blocks the UI. Restarting Excel clears the application memory and restores the step-by-step F8 functionality.

Is there a shortcut to clear all breakpoints in Excel VBA?

Yes, you can press Ctrl + Shift + F9 on your keyboard, or navigate to the Debug menu in the Visual Basic Editor and select 'Clear All Breakpoints'.

Does F8 work differently on a laptop keyboard?

On many modern laptops, the function keys (F1-F12) are mapped to media controls by default. You may need to press Fn + F8 to step through VBA code, or toggle the Fn Lock feature on your keyboard.

What does Shift + F8 do in VBA debugging?

Shift + F8 is the 'Step Over' command. It executes the highlighted line of code, but if that line calls another macro or function, it runs that entire procedure in the background without stepping into its individual lines.