Excel’s spell check (F7) goes through mistakes one at a time. This VBA macro instead highlights every cell on the sheet that contains a misspelled word, so you can see them all at once.
Works inExcel 2010 and later, Windows and Mac
UndoNot possible. Save a copy first
Save asMacro-Enabled Workbook (.xlsm)
New to macros? See how to use the macros on this site: copy the code, paste it into a module with Alt + F11, and run it with Alt + F8.
Table of Contents
Highlight cells with spelling mistakes
Sub HighlightMisspelled()
Dim c As Range, w As Variant
For Each c In ActiveSheet.UsedRange
If VarType(c.Value) = vbString And Not c.HasFormula Then
For Each w In Split(c.Value, " ")
If Len(w) > 1 Then
If Not Application.CheckSpelling(Word:=CStr(w)) Then
c.Interior.Color = RGB(255, 235, 156)
Exit For
End If
End If
Next w
End If
Next c
End Sub
Each cell is split into words, and each word is checked against Excel’s dictionary. Cells with at least one unknown word get a yellow fill.
Without a macro
- Click cell A1 and press F7.
- Excel shows each misspelled word in turn. Choose Change, Ignore or Add to Dictionary.
Things to know
- Names, product codes and Malayalam or Hindi words aren’t in the English dictionary, so they’ll be highlighted too. Add common ones with Add to Dictionary in the F7 spell check.
- Words next to punctuation, such as Kochi, may be flagged. It’s a quick visual check, not a full proofreader.
- On large sheets the macro takes a few seconds, because every word is checked.