Thread: Spell Checking
View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Dave[_9_] Dave[_9_] is offline
external usenet poster
 
Posts: 12
Default Spell Checking

Thanks Steve,
I will give that a try

dave

"Incidental" wrote in message
...
Hi Dave

Sorry if i wasn't very clear with my last post. This code will not
spell check on the fly like word that would be a whole different ball
game with loads more code and head aches, it will only take the value
of the textbox put it into a cell and then check the spelling of the
value you put in the cell. Then will check the spelling of the text
in the cell and when all changes have been made it will replace the
text in the textbox with the corrected text from the cell. Lastly it
will clear the cell again just to clean up a bit. I have commented
each line of code on the line directly below it but to see better how
it works create a form with a textbox and a button on it (both with
default names) paste the code below into the forms code module and
then run the form and try typing things in the textbox then press the
button to spell check.

Option Explicit

Private Sub CommandButton1_Click()

With Sheets(1)
'tell excel which sheet you want to work with

.Cells(1, 1).Value = TextBox1.Value
'get the value from the textbox and put it in to a cell on the sheet

.Cells(1, 1).CheckSpelling SpellLang:=2057
'check the cell to see if it is spelt correctly

TextBox1.Value = .Cells(1, 1).Value
'if any word is spelt wrong the spell checking window will pop up
'just like any of the office apps

.Cells(1, 1).Value = ""
'clean up

End With
'close the with statement

End Sub

Hope this is a little clearer for you

Steve