Excel Auto Protect Sheet: How to Lock It
In this article
Excel's auto-protect sheet feature lets you lock cells, hide formulas, and restrict editing without manually setting permissions for every cell. You turn it on with one command, and Excel applies the protection to the entire sheet, only allowing changes where you've explicitly unlocked cells beforehand. Here's how to use it correctly, what it does and doesn't do, and how to avoid the most common mistakes.
What Sheet Protection Actually Does
When you protect a worksheet, Excel locks every cell by default. That means no one can type into, delete, or modify any cell unless you unlock it first. The protection also blocks structural changes like inserting or deleting rows and columns, and it can hide formulas from the formula bar.
It's important to understand that this is not encryption. Sheet protection uses a password that Excel stores in a way that can be removed by specialized tools. It's meant to prevent accidental edits and to guide others toward only the cells they should use. If you need real security, you should encrypt the whole workbook with a password (File > Info > Protect Workbook > Encrypt with Password).
How to Protect a Sheet (Step by Step)
- Open the worksheet you want to protect.
- Select the cells you want users to be able to edit (for example, input cells).
- Right-click the selection and choose Format Cells (or press Ctrl+1).
- Go to the Protection tab and uncheck Locked. Click OK.
- Now go to the Review tab and click Protect Sheet.
- In the dialog, you can set a password (optional) and choose what actions are allowed. The default allows users to select locked and unlocked cells, but not edit them.
- Click OK, and if you set a password, confirm it.
- Select cells (both locked and unlocked).
- Edit unlocked cells.
- Use the Tab key to move between unlocked cells.
- Print the sheet.
- Apply formatting to unlocked cells (if you allow it).
- Edit locked cells.
- Change row heights or column widths (unless you allow it in the dialog).
- Insert or delete rows, columns, or sheets.
- View formulas in locked cells (if you check "Hide formulas" in the Protection tab).
- Move or resize objects like charts or shapes (unless you allow it).
- Allow Edit Ranges: In the Review tab, click "Allow Edit Ranges" to assign different unlocked cells to different users or passwords. This is useful when multiple people need to edit different parts of the same sheet.
- Data Validation: Instead of protecting, you can use data validation to restrict what users type into cells (e.g., a drop-down list). This doesn't prevent editing, but it prevents invalid entries.
- SharePoint or OneDrive co-authoring: If you're using Excel online, you can share the file and set permissions at the file level, which is often easier than sheet protection.
- VBA macros: For advanced users, a macro can automatically protect and unprotect sheets with a button, or protect on save. This requires some coding knowledge.
That's the core workflow. If you skip step 3-4, every cell stays locked and the sheet becomes read-only, which is rarely what you want.
What Can Users Still Do After Protection?
By default, after protecting a sheet, users can still:
But they cannot:
You control these by checking or unchecking the options in the Protect Sheet dialog. For example, if you want users to sort a table but not edit the data, you can check "Sort" and "Use AutoFilter" while leaving other options off.
How to Unprotect a Sheet
To remove protection, go to the Review tab and click Unprotect Sheet. If you set a password, Excel will ask for it. If you didn't set a password, it unprotects instantly.
If you forgot the password, there's no built-in "recover" option. You can try to remember it, or use a third-party tool, but those are not guaranteed and may not be safe. The best practice is to keep the password in a safe place, or simply not use a password if the protection is only to prevent accidental edits.
Common Mistakes and How to Avoid Them
The most frequent error is protecting the sheet before unlocking the input cells. The result is a sheet where nothing can be edited, and users complain that the file is "broken." Always unlock the editable cells first.
Another mistake is thinking that protection hides data. It doesn't. Hidden formulas are only hidden from the formula bar, but the result is still visible. And if you hide a column or row, protection doesn't prevent a user from unhiding it unless you also protect the sheet structure (which you do by default).
A third issue: if you allow users to select locked cells, they can still copy them and paste elsewhere. That's often fine, but if you want to prevent copying, you'd need to also disable the "Select locked cells" option, which makes the sheet feel very restrictive.
Comparison: Protect Sheet vs. Protect Workbook
Excel has two different protection levels. Protect Sheet (Review > Protect Sheet) locks the content of a single worksheet. Protect Workbook (Review > Protect Workbook) locks the structure of the whole workbook, preventing users from adding, moving, or deleting sheets. You can use both together.
There's also Encrypt with Password (File > Info > Protect Workbook), which actually encrypts the file. That's the only option that prevents someone from opening the file without the password. Sheet protection is not a security measure; it's a usability measure.
Alternatives to Manual Protection
If you find yourself protecting sheets often, consider these alternatives:
Frequently Asked Questions
Can I protect only certain cells in Excel?
Yes. By default, all cells are locked, so you need to unlock the cells you want users to edit. Select those cells, open Format Cells (Ctrl+1), go to the Protection tab, and uncheck "Locked." Then protect the sheet. Only the unlocked cells will be editable.
What happens if I forget the sheet protection password?
There is no official way to recover it. You can try to remember it, or use third-party password recovery tools, but they may not work and could be risky. To avoid this, either keep a record of the password or skip the password entirely if you only need to prevent accidental edits.
Does protecting a sheet hide formulas?
Not automatically. To hide formulas, you must first select the cells with formulas, open Format Cells, go to the Protection tab, and check "Hidden." Then protect the sheet. After that, the formula bar will show nothing for those cells, and users cannot see the formula.
Why can't I edit cells after protecting the sheet?
Because all cells are locked by default. You need to unlock the cells you want to be editable before protecting. If you already protected the sheet, unprotect it, unlock the desired cells, then protect again.
Can users still copy data from a protected sheet?
Yes, if you allow selecting locked cells, they can copy the values and paste them elsewhere. To prevent copying, you'd need to uncheck "Select locked cells" in the Protect Sheet dialog, but that also prevents them from selecting those cells at all, which may be too restrictive.