Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Is there a SPELL function or its equivalent?

1 view
Skip to first unread message

Salmon Egg

unread,
Oct 31, 2010, 5:02:38 AM10/31/10
to
I am trying to detect, not correct, spelling errors in a list of words
and non-words. I would like a function that will take a string in a cell
specified in one of the usual ways that would give me a logical value of
TRUE if it is spelled correctly and FALSE if it spelled incorrectly. I
could then sort on those values to segregate them into words and
non-words. At this time. I am willing to use the default dictionary or a
specified dictionary for the purpose. A macro would be OK as well.

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.

Hans Terkelsen

unread,
Nov 1, 2010, 8:34:42 AM11/1/10
to

"Salmon Egg" <Salm...@sbcglobal.net> wrote in message news:SalmonEgg-567CA...@news60.forteinc.com...

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.

0 new messages