How to Run Excel VBA Macros Step-by-Step on Mac
Question details
The user wants to know the Mac keyboard shortcut and method to execute a VBA macro one line at a time in the Visual Basic Editor.

- Product
- Microsoft Excel for Mac
- Device & OS
- macOS
- Scenario
- Debugging VBA code to find errors or to understand the execution flow line-by-line.
- Observed behavior
- Needs to execute code incrementally instead of running the entire macro script at once.
Ensure you have the Developer tab enabled in your Excel ribbon and have a VBA macro script ready to debug in the Visual Basic Editor.
Use the Mac Keyboard Shortcut for Step-by-Step Execution
The quickest and most efficient way to step into and run VBA code line-by-line on a Mac is by using the dedicated debugging keyboard shortcut.
While Windows users rely on the F8 key, the Mac version of Excel has a specific combination for stepping into VBA code. Memorizing this shortcut will significantly speed up your debugging process.
Launch Microsoft Excel, navigate to the Developer tab, and click on 'Visual Basic' to open the Visual Basic Editor (VBE).
In the code module, click to place your text cursor anywhere inside the VBA procedure (macro) you want to debug.
Press Shift+Command+I on your Mac keyboard. The first line of the macro will be highlighted in yellow. Continue pressing Shift+Command+I to execute the code one line at a time.

Use the Visual Basic Editor Debug Menu
If you prefer using the mouse or are unable to use keyboard shortcuts, you can access the step-by-step execution tool directly from the VBE menu.
Looking for a Lightweight Spreadsheet Alternative?
While running complex VBA macros is a Microsoft Excel-specific feature, many users find that their everyday spreadsheet data analysis and formatting needs are perfectly met by a lighter, faster alternative. WPS Office offers a powerful spreadsheet tool completely free of charge.
- 1. Download: Visit the official WPS Office website and download the installer for Mac.
- 2. Install: Open the downloaded package and drag the WPS Office icon to your Applications folder.
- 3. Start Creating: Launch WPS Spreadsheet and instantly open your existing Excel workbooks.

Frequently Asked Questions
Why is 'Step Into' grayed out in the Debug menu?
The 'Step Into' option may be disabled if a macro is currently running, if there is a syntax error preventing the code from compiling, or if your cursor is not placed inside a valid Sub or Function procedure.
What is the Windows equivalent shortcut for stepping through VBA code?
On a Windows PC, you can press the F8 key to step through VBA macro code line by line, whereas on a Mac, the corresponding shortcut is Shift+Command+I.
How do I stop a macro that is running step-by-step?
To stop the debugging process, go to the Run menu in the Visual Basic Editor and click 'Reset', or press the square Stop (Reset) button on the standard toolbar at the top of the window.




