Spell or Dictionary function

S

Salmon Egg

One of the things I do with Excel is work onwortfd puzzles. It would be
useful for me to have a function that uses the contents of a cell as the
argument. The function returns a value, say TRUE or FALSE depending upon
whether the argument is spelled correctly or not. An alternative would
be a function that returns whether the cell contains a word found in a
dictionary.

Spell checking in Excel seems to be one word at a time using manual
interactiom. I would like to use words within a column ghat I could sort
with respect to whether the words are spelled correctly.

I have not been able to locate a function to help me out. Mayube there
is one hidden away in Excel, but if so, I have not found it.

Bill
 
A

AltaEgo

Sub SpellCHK()
'Check spelling of selection
'Place result
' (True or False) in adjacent cell

Dim C
For Each C In Selection

C.Offset(, 1) = Application.CheckSpelling(C)
Next C

End Sub
 
S

Salmon Egg

AltaEgo said:
Sub SpellCHK()
'Check spelling of selection
'Place result
' (True or False) in adjacent cell

Dim C
For Each C In Selection

C.Offset(, 1) = Application.CheckSpelling(C)
Next C

End Sub

I do not fully understand this yet. I presume that this is a Visual
Basic subroutiner. I have not used VB to generate macros ye. This seems
to be a good way to get my feet wet.

Bill
 
A

AltaEgo

Yes, it is VBA. Whilst the code works, it shows the structure of use rather
than a means to employ it in your spreadsheet. That will depend how you
intend to use it.

1) Open the Visual Basic Editor (Tools > Macro > Visual Basic Editor or
ALT+F11).

2) Insert / Module.

3) In the new empty module, paste the code

4) Back in your Excel sheet, highlight the column of words you want to
check.

5) Click [Alt]/[F8] to bring up the run macro list. Choose SpellCHK and
press [OK]

The column next to the highlighted row will fill with TRUE or FALSE.

In a project, such as creating a puzzle, you would normally run code from a
macro button. How to do it from a button on the worksheet:
http://www.mrexcel.com/tip068.shtml

Other ways:
http://office.microsoft.com/en-us/excel/HP052023061033.aspx

OK, you have some basics. With a little more knowledge, you can modify the
code so you don't need to select the range every time. You can automate the
sort so it runs on the same button-click. Almost anything is possible with
VBA.

If you want further help, just ask.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top