Spell Check Unlocked Cells Only
Sub test()
Dim rngUnlocked As Range
Dim rng As Range
For Each rng In UsedRange
If rng.Locked = False Then
If rngUnlocked Is Nothing Then
Set rngUnlocked = rng
Else
Set rngUnlocked = Union(rng, rngUnlocked)
End If
End If
Next rng
ActiveSheet.Unprotect
rngUnlocked.CheckSpelling _
CustomDictionary:="CUSTOM.DIC", _
IgnoreUppercase:=False, _
AlwaysSuggest:=True
ActiveSheet.Protect
End Sub
--
HTH...
Jim Thomlinson
"Dorci" wrote:
Sorry, I was rushed -- I misspelled Excel and didn't post an actual question.
Is there a way to specify "only unlocked cells" in the following spell check
code?
ActiveSheet.Unprotect
Cells.CheckSpelling _
CustomDictionary:="CUSTOM.DIC", _
IgnoreUppercase:=False, _
AlwaysSuggest:=True
ActiveSheet.Protect
|