Spellchecker in Protected Sheet

Rocksie

New Member
Joined
May 17, 2017
Messages
26
Hi All,

I need to check the spelling of user input fields in a protected workbook. Users are only able to select and edit e.g. range E2:E21. I need the spell checker to work as the normal excel one, i.e, the cell with the misspelled word must be selected in order for me to know where the misspelled word is.

Any help will be appreciated.

Thanks
 

Excel Facts

Best way to learn Power Query?
Read M is for (Data) Monkey book by Ken Puls and Miguel Escobar. It is the complete guide to Power Query.
Here's a code segment I've used in the past. To set up, I created a VeryHidden sheet with the codename Spell. (Look in the property window within VBA for (Name) and change there.) Also, change the visible to 2-xlSheetVeryHidden.

Code:
Function GetSpelling(ByVal str As String) As String
Dim Rng As Range
Set Rng = Spell.[A1]
Rng = str
Rng.CheckSpelling , , , 1033
GetSpelling = Rng
Rng.ClearContents
End Function

To deploy, you could add a check on the exit event of each textbox or to a Command Button Click event.
 
Upvote 0
Hi CalcSux78, Thanks for the code, but I don't get it to work....

Any other suggestions? I have an active X button that activates the code

Thanks
 
Upvote 0
If you have an ActiveX button on your worksheet... you can right click the button and select "View Code" and use this code:

Code:
Private Sub CommandButton1_Click()
Dim rng As Range
Dim cel As Range


Set rng = [E2:E20]
For Each cel In rng.Cells
    cel.CheckSpelling , , , 1033
Next cel
End Sub
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,181
Members
453,022
Latest member
Mohamed Magdi Tawfiq Emam

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top