How to Lock a Sheet in Excel: Step-by-Step Guide
In this article
To lock a sheet in Excel, you protect the worksheet so that cells you haven't explicitly unlocked can't be edited. The quickest path is Review > Protect Sheet, set an optional password, and click OK. Before you do that, unlock any cells that should remain editable, because every cell is locked by default once protection is on. This guide walks through the full process on Windows and Mac, plus the mistakes that make people think protection isn't working.
What You'll Need
- Excel for Windows, Mac, or Excel for the web (the Review tab is present in all three; labels can differ slightly by version, device, or region).
- The workbook open, with the sheet you want to protect active.
- Optional: a password you'll remember. If you lose it, Microsoft cannot recover it, and you'll be locked out of editing that sheet.
Step-by-Step
- Decide what should stay editable. By default, every cell in Excel has the Locked property turned on, but that property only takes effect after you protect the sheet. If you want people to type in certain cells (for example, an input column), select those cells now, press Ctrl+1 (Cmd+1 on Mac) to open Format Cells, go to the Protection tab, and clear the Locked checkbox. Click OK.
- Go to the Review tab. On Windows and Mac, click Review on the ribbon. In Excel for the web, the Review tab is also where protection lives.
- Click Protect Sheet. In the Protect group, click Protect Sheet. A dialog box opens.
- Set a password (optional but recommended). Type a password in the box. Leave it blank if you only want to prevent accidental edits; anyone can then unprotect the sheet with two clicks. A password stops casual changes but is not strong security.
- Choose what users are allowed to do. The list below the password box lets you permit actions such as selecting locked cells, selecting unlocked cells, formatting cells, inserting rows, or sorting. By default, selecting locked and unlocked cells is allowed, which is usually what you want. Tick only the actions you're comfortable with.
- Click OK. If you set a password, Excel asks you to confirm it. Re-type it and click OK. The sheet is now protected: locked cells can't be edited, and the options you cleared are disabled.
- Test it. Click a locked cell and try to type. Excel should show a message that the cell or chart you're trying to change is on a protected sheet. Click an unlocked cell and confirm you can still edit it.
- To remove protection later, go back to Review > Unprotect Sheet. If you set a password, you'll need to enter it. On Mac, the button may read Unprotect Sheet in the same Protect group.
Common Mistakes
- Forgetting to unlock input cells first. Protection locks everything that still has the Locked property set. Unlock the editable cells before you protect, not after.
- Confusing sheet protection with workbook protection. Protect Sheet stops edits inside one worksheet. Protect Workbook (also on the Review tab) stops people from adding, deleting, or renaming sheets. They are separate settings and you may need both.
- Assuming a password makes the file secure. Sheet protection is designed to prevent accidental and casual changes, not to encrypt data. Anyone determined can remove it with third-party tools. For real security, use File > Info > Protect Workbook > Encrypt with Password, which encrypts the whole file.
- Protecting the wrong sheet. Protection applies to the active sheet only. If you have several sheets, repeat the steps on each one, or group sheets first (Ctrl+click tabs) and then protect.
- Losing the password. There is no built-in recovery. Keep it in a password manager or a safe place.
Tips
- Use the Allow Users to Edit Ranges option (Review > Allow Edit Ranges) if you want specific users to edit specific ranges with their own passwords, without unprotecting the whole sheet.
- Before protecting, check for merged cells and array formulas in the editable area; they can behave unexpectedly when protection is on.
- If you need to protect many sheets at once, right-click a sheet tab, choose Select All Sheets, then apply Protect Sheet. Be aware this groups the sheets, so any edit you make afterward applies to all of them until you ungroup.
- Keep a copy of the unprotected workbook as a backup before you add passwords, in case you need to start over.
- On shared workbooks, protection settings travel with the file, so test after saving and reopening.
Troubleshooting
You can still edit a cell you expected to be locked. That cell's Locked property is probably cleared. Unprotect the sheet, select the cell, open Format Cells > Protection, tick Locked, and protect again.
The Protect Sheet button is greyed out. The workbook may be shared (Review > Share Workbook) or the sheet may already be protected. Check the button label: if it says Unprotect Sheet, protection is already on. If the workbook is shared, turn off sharing first, then protect.
You forgot the password. Excel has no official recovery. Restore an earlier unprotected copy from version history or backup if one exists. Otherwise, the sheet cannot be unprotected through normal means; do not use unofficial password-removal tools on files you don't own.
Users can't sort or filter. Those actions are unchecked in the Protect Sheet dialog by default. Unprotect, re-protect, and tick Sort and Use AutoFilter if you want them allowed.
Protection seems to disappear after saving. Make sure you saved as .xlsx or .xlsm, not as a format that drops protection settings, and confirm you protected the correct sheet. Reopen the file and check Review > Protect Sheet to see the current state.
Frequently Asked Questions
Does locking a sheet hide the data?
No. Protection prevents edits; it does not hide cells or their contents. To hide data, use Format > Hide or set column/row visibility before protecting.
Can I lock only part of a sheet?
Yes. Unlock the cells you want editable (Format Cells > Protection > clear Locked), then protect the sheet. Everything still marked Locked becomes read-only.
Is sheet protection the same as password-protecting the file?
No. Protect Sheet restricts editing inside a worksheet. File > Info > Protect Workbook > Encrypt with Password encrypts the entire file and requires the password to open it.
Can someone bypass sheet protection?
Sheet protection is not strong security and can be removed by someone with the right tools. Use it to prevent mistakes, and use file encryption for confidential data.
Does protecting a sheet stop macros from running?
No. Macros can still run, but they may fail if they try to change locked cells. Adjust the macro or unprotect the sheet within the code if needed.
Will protection carry over if I copy the sheet?
When you copy a protected sheet within the same workbook, the copy is also protected. If you move it to another workbook, check the protection state after pasting.