VBA & Macro Problems

Fix Spaces Disappearing in the Excel for Mac VBA Editor

Huda QurayshiHuda Qurayshi Nov 22, 2026 869 views

Question details

The user needs to stop the Excel for Mac VBA editor from removing spaces while code is being typed.

Fix Spaces Disappearing in the Excel for Mac VBA Editor
Product
Microsoft Excel for Mac VBA editor
Device & OS
macOS 10.14.4
Scenario
Editing VBA code in Excel for Mac version 16.22.
Observed behavior
Spaces disappear as they are typed, so the user must insert them after completing each line. The Tab key also has the same problem.
Before you start

In Excel, open Excel > About Excel to confirm your version. Check the macOS version under Apple menu > About This Mac, and note whether the Tab key is also affected.

Solution 1Recommended

Update Excel and macOS to Compatible Versions

Use this approach first because the behavior may be a bug in the installed Excel for Mac build or its VBA editor.

1
Check for Office updates

In Excel, choose Help > Check for Updates and install the latest Office updates available for your Mac.

2
Check for macOS updates

Open Apple menu > System Preferences > Software Update and install any compatible macOS updates offered.

3
Restart and test

Quit and reopen Excel, then open the VBA editor and type a line of code containing spaces to see whether they remain.

Update Excel and macOS to Compatible Versions
Update availability: The newest Office release may require a newer macOS version. Install the latest versions compatible with your Mac.
Free Microsoft Office alternative

Work on Spreadsheets with WPS Office

WPS Office is a free, lightweight Microsoft Office alternative with a familiar interface and Excel format compatibility for a smoother move between spreadsheet tools. It does not fix Microsoft's VBA editor, and VBA support may vary by version.

Edit spreadsheets in a familiar, easy-to-use interfaceOpen and save Microsoft Excel .xlsx filesUse a lightweight office suite with a free versionContinue spreadsheet work while troubleshooting the Excel VBA editor
microsoft office alternative - wps office

Frequently Asked Questions

Why does the Excel for Mac VBA editor remove spaces as I type?

The behavior may be a bug in the installed Excel build or its VBA editor. Use Excel > About Excel to check your version, then install compatible updates through Help > Check for Updates.

Can I use the Tab key instead of spaces?

Not necessarily. In the reported case, the Tab key was affected too. Try composing the code in a plain-text editor and pasting it into the VBA module instead.

How do I report the problem to Microsoft?

In Excel, look for Help > Feedback or Help > Send Feedback. Include your Excel and macOS versions and describe how to reproduce the disappearing spaces.

Will WPS Office fix the Excel VBA editor?

No. WPS Office is an alternative for spreadsheet work, but it does not repair Microsoft's VBA editor. VBA support can vary by WPS version.