If I understand the way spell checking works, each error has to be
handled individually for correction. That is not what I want.
Bill
--
An old man would be better off never having been born.
Hi Bill.
The VBA expression Application.CheckSpelling("a string") returns True or False.
See the Help for more arguments of CheckSpelling.
So one would suppose it could be used in a userdefined function,
that could be called SPELL.
But Application.CheckSpelling does not seem to work in a Function,
only in a Sub.
At least I can't make it work in a Function.
Therefore the following more clumsy solution.
Right click the sheet tab and go to its codesheet, and put
''''''''''''''''''''''''''''''''''''
Private Sub Worksheet_Change(ByVal Target As Range)
Dim cl, spellrange
On Error GoTo out
Application.EnableEvents = False
Set spellrange = [a1:a10]
'The cells to the right of that will get True, False or empty
For Each cl In spellrange.Cells
If IsEmpty(cl) Then
cl.Offset(0, 1).Formula = ""
Else
cl.Offset(0, 1).Value = Application.CheckSpelling(cl.Value)
End If
Next
out:
Application.EnableEvents = True
End Sub
''''''''''''''''''''''''''''''''''''
I have supposed that your list of words is included in A1:A10,
but change that to suit you.
The answer, TRUE, FALSE or empty cell will appear to the right of the spellrange,
here B1:B10, and you could sort on that
The eventcode runs every time the sheet changes, like a volatile function would operate.
Hans T.