Color cell if spell check finds an error

L

LiveUser

This may be very simple and I am totally over looking it, or tricky. I want
to somehow spellcheck all of the cells and if spellcheck finds an errors than
those cells will be highlighted permantly until I unhighlight them.
 
G

Gary''s Student

Select the cells and run this small macro:

Sub spellcolor()
For Each r In Selection
If Application.CheckSpelling(r.Value) Then
Else
r.Interior.ColorIndex = 6
End If
Next
End Sub


This only colors the cells, it does not bring up the dialog.
 
L

LiveUser

Thank you Gary''s Student. It worked well.

If you don't mind or have time. Could you explain how this works within
Visual Basic?
 
G

Gary''s Student

Usually from the worksheet, spell check runs across may cells, stopping only
if it find a problem. The way we are using it, we get the contents of the
individual cells and tell spell check to only check that string.

Used in this fashion spellchecker only give back a TRUE/FALSE, without the
correction dialog. Based upon the response, we color the cell the text came
from.
 

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