This may get you started:
Sub Demo()
CheckSpelling ActiveSheet.UsedRange
End Sub
Sub CheckSpelling(r As Range)
' shg 2009
Dim cell As Range
Dim asWd() As String
Dim s As String
Dim iWd As Long
Dim iPos As Long
For Each cell In r
If Not cell.HasFormula And Not IsNumeric(cell.Value) Then
s = cell.Value
s = Replace(s, Chr(160), " ") ' replace non-breaking spaces
asWd = Split(s, " ")
iPos = 1
cell.Font.Underline = xlUnderlineStyleNone
For iWd = 0 To UBound(asWd)
With Application.SpellingOptions
' .IgnoreCaps = ?? ' set as desired
.IgnoreFileNames = True
.IgnoreMixedDigits = True
' .UserDict = ?? ' got one?
End With
If Not Application.CheckSpelling(Word:=asWd(iWd)) Then
cell.Characters(iPos, Len(asWd(iWd))).Font.Underline = xlUnderlineStyleSingle
End If
iPos = iPos + 1 + Len(asWd(iWd))
Next iWd
End If
Next cell
End Sub
Bookmarks