How to Spell-Check the Same Range on Every Excel Worksheet Using VBA
Question details
The user needs to spell-check a specific, fixed cell range across all worksheets in an Excel workbook using a VBA macro.

- Product
- Excel
- Device & OS
- not provided
- Scenario
- Automating the spell-check process for a consistent range of cells (e.g., E30:G89) across multiple worksheets to avoid checking each sheet manually.
- Observed behavior
- Standard VBA code using 'ActiveSheet' only checks the currently selected worksheet, failing to process the rest of the workbook.
Ensure your workbook is saved as a Macro-Enabled Workbook (.xlsm) and identify the exact cell range (e.g., E30:G89) you want to spell-check across your sheets.
Use a VBA Loop to Spell-Check All Worksheets
This is the recommended method to iterate through every worksheet in your workbook and spell-check a specific range automatically.
By looping through the 'Worksheets' collection, you can apply the CheckSpelling method to a specific range on every sheet without needing to activate them individually. This runs in the background and is highly efficient.
Press Alt + F11 on your keyboard to open the Visual Basic for Applications (VBA) Editor in Excel.
In the top menu, click 'Insert' and select 'Module' to create a blank script window.
Copy and paste the following code into the module window: Sub SpellCheckAllSheets() Dim ws As Worksheet Application.ScreenUpdating = False For Each ws In ThisWorkbook.Worksheets ws.Range("E30:G89").CheckSpelling CustomDictionary:="CUSTOM.DIC", IgnoreUppercase:=False, AlwaysSuggest:=True, SpellLang:=1033 Next ws Application.ScreenUpdating = True End Sub
Change the range "E30:G89" to the specific cell range you want to check. You can also modify the dictionary name or set IgnoreUppercase to True if needed.
Press F5 or click the green 'Run' button in the toolbar to execute the macro. Excel will now spell-check that range across all sheets.

Spell-Check a Range on the Active Sheet Only
Use this simplified macro if you only need to enforce spell-checking on a fixed range within your currently selected worksheet.
Automate Excel Workbooks with WPS Spreadsheet VBA
WPS Office offers robust VBA support in its advanced versions, allowing you to run powerful macros, loop through worksheets, and automate repetitive tasks just like Microsoft Excel.
- 1. Open your Workbook in WPS Spreadsheet: Launch WPS Office and open your .xlsm file containing the data you want to spell-check.
- 2. Access the Developer Tab: Navigate to the 'Developer' tab on the top ribbon. If it is hidden, enable it in the WPS Options menu.
- 3. Open the VBA Editor: Click on the 'VBA Editor' icon to open the scripting environment.
- 4. Paste and Run Your Macro: Paste your 'SpellCheckAllSheets' macro into a module and click 'Run' to seamlessly check your ranges.

Frequently Asked Questions
Can I run this macro if my worksheets are password protected?
If the cells within your specified range are locked and the sheet is protected, the spell-checker might fail. You must add 'ws.Unprotect "YourPassword"' at the beginning of the loop and 'ws.Protect "YourPassword"' before the 'Next ws' statement.
How do I change the macro to spell-check the entire worksheet instead of a fixed range?
To check the whole worksheet, replace 'ws.Range("E30:G89").CheckSpelling' with 'ws.Cells.CheckSpelling' in your VBA code.
Why is the spell-checker ignoring words in all capital letters?
The behavior depends on the IgnoreUppercase parameter in the code. If your code says 'IgnoreUppercase:=True', it will skip acronyms and uppercase words. Change it to 'IgnoreUppercase:=False' to enforce checking for capitalized words.
What is the CUSTOM.DIC dictionary in the code?
CUSTOM.DIC is the default custom dictionary file where Excel stores words you have manually 'Added to Dictionary'. Including this parameter ensures the macro respects your previously saved custom vocabulary.




