
Tips.Net > ExcelTips Home > Tools > Spelling and Grammar Checking > Spell-Checking in a Protected Worksheet
Summary: When you protect a worksheet, you can’t use some tools, including the spell-checker. If you want to use it, you must unprotect the worksheet, run the check, and then protect it again. All of this can be done quite quickly by using the macros discussed in this tip. (This tip works with Microsoft Excel 97, Excel 2000, Excel 2002, Excel 2003, and Excel 2007.)
Craig has a protected Excel worksheet in which he would like to spell-check a specific cell. The problem, of course, is that the spell-checker cannot be run on a protected worksheet. So, the process of doing the desired spell-checking is to unprotect the worksheet, do the check, and then again protect the worksheet.
In order to have the macro complete these steps, you must know the password used to protect the worksheet. The following simple example assumes that the password is "mypass."
Sub SpellCheckCell1()
With ActiveSheet
.Unprotect ("mypass")
.Range("A15").CheckSpelling
.Protect ("mypass")
End With
End Sub
You'll obviously need to change the password used in the macro to the one appropriate for your worksheet. You'll also need to change the cell being checked; this macro checks cell A15. If you would rather have the macro check whatever cell is selected when the macro is run, then you can change it in this manner:
Sub SpellCheckCell2()
With ActiveSheet
.Unprotect ("mypass")
Selection.CheckSpelling
.Protect ("mypass")
End With
End Sub
Regardless of which macro you use, you can assign it to a shortcut key or a toolbar button in order to make it easy to run. (How you do these assignments has been discussed in other ExcelTips issues.)
Tip #3144 applies to Microsoft Excel versions: 97 2000 2002 2003 2007
Got the Time? Understanding the ins and outs of working with times and dates can be confusing. Remove the confusion--ExcelTips: Times and Dates is an invaluable resource for learning how best to work with times and dates.
Check out ExcelTips: Times and Dates today!
You can put times into a worksheet, but then what? Need to do calculations with times? How about working with elapsed time? Don't be confused; learn how easy it can be. (more information...)
Ask an Excel Question
Make a Comment
ExcelTips FAQ
ExcelTips Premium
Beauty Tips
Bugs and Pests Tips
Car Tips
Cleaning Tips
College Tips
Cooking Tips
Excel2007 Tips
ExcelTips
Family Tips
Gardening Tips
Health Tips
Home Tips
Money Tips
Organizing Tips
Pet Tips
Word2007 Tips
WordTips
Advertise on the
ExcelTips Site