Lock your Excel file to prevent accidental or unwanted changes
You can lock an Excel file in two ways: protect the entire workbook so no one can open it without a password, or protect individual sheets so people can view them but not edit specific cells. Most people need sheet protection, which lets you decide which cells stay locked and which ones stay editable. Workbook protection is stronger but less flexible — it locks the whole file and requires a password to open it at all.
The method you choose depends on what you're protecting against. If you want to prevent accidental edits to a formula or a summary section while letting people fill in data elsewhere, use sheet protection. If you want to keep the entire file private and password-protected, use workbook protection. You can use both at the same time.
Key Takeaways
- Sheet protection lets people view and edit specific cells you choose, while locking down formulas and headers — this is what most people need.
- Workbook protection password-protects the entire file so it cannot be opened without entering a password first.
- Before you protect a sheet, unlock the cells you want people to edit, because all cells are locked by default.
- Excel does not encrypt passwords, so a determined person with technical knowledge can remove sheet protection — use workbook protection if security is critical.
- You can protect a sheet without setting a password, which prevents accidental changes but not intentional ones.
Protect a single sheet so people can edit only certain cells
Sheet protection is the most common choice. It lets you lock down formulas, headers, and sensitive data while leaving other cells open for input. The process has two steps: first unlock the cells you want people to edit, then protect the sheet.
Start by selecting all the cells you want to remain editable. Click the column header at the top left (the box where the row numbers and column letters meet) to select the entire sheet. Right-click and choose Format Cells. Go to the Protection tab and uncheck the box next to Locked. Click OK. Now every cell on the sheet is unlocked.
Next, select only the cells you want to lock — the ones people should not change. This might be a header row, a column of formulas, or a summary section. Right-click, choose Format Cells, go to the Protection tab, check Locked, and click OK. Now protect the sheet: go to the Review tab (or Tools on Mac), click Protect Sheet, and choose whether to set a password. If you set a password, people will need it to unprotect the sheet later. If you leave it blank, anyone can unprotect it, but accidental edits are still prevented. Click OK.
Test it by clicking a locked cell and trying to type — nothing will happen. Click an unlocked cell and you should be able to edit normally. If the locked cells are still editable, you may have selected them in the wrong order. Unprotect the sheet, redo the steps, and protect it again.
Protect the entire workbook with a password
Workbook protection locks the whole file and requires a password to open it. This is stronger than sheet protection but less flexible — people cannot view the file at all without the password.
Go to the Review tab (or Tools on Mac) and click Protect Workbook. A dialog will ask you to set a password. Type a password you will remember, click OK, type it again to confirm, and click OK. The workbook is now password-protected. The next time someone tries to open the file, they will be prompted for the password.
Write down your password somewhere safe. If you forget it, you cannot recover the file — Excel does not have a password recovery system for workbooks. Some third-party tools claim to crack Excel passwords, but they are unreliable and may contain malware. Prevention is your only option.
Understand what sheet protection does and does not do
Sheet protection prevents accidental changes and stops casual editing, but it is not encryption. Someone with technical knowledge and free tools can remove sheet protection in minutes, even with a password set. If you need real security — protecting trade secrets, financial data, or confidential information — use workbook protection with a strong password, or use a file encryption tool outside of Excel.
Sheet protection also does not prevent someone from copying your data. They can select unlocked cells, copy them, and paste them elsewhere. If you need to prevent copying, you need encryption or a different approach entirely.
One useful feature: when a sheet is protected, you can still sort and filter data in unlocked cells, and you can still insert or delete rows and columns if you allow it in the protection settings. When you click Protect Sheet, a dialog shows checkboxes for what people are allowed to do — you can let them sort and filter but not delete rows, for example.
Unprotect a sheet or workbook when you need to make changes
To unprotect a sheet, go to the Review tab and click Unprotect Sheet. If you set a password, you will be prompted to enter it. If you did not set a password, the sheet unprotects immediately.
To unprotect a workbook, go to the Review tab and click Unprotect Workbook. Again, you will need the password if you set one. Once unprotected, you can edit locked cells, change the sheet structure, and make any other changes. Protect it again when you are done.
Protect multiple sheets at once
If your workbook has several sheets and you want to protect all of them with the same settings, you can protect them one at a time using the steps above, or you can select multiple sheets first and protect them together.
Right-click on a sheet tab at the bottom and choose Select All Sheets. Now go to the Review tab and click Protect Sheet. The protection settings you choose will apply to every sheet in the workbook. This is faster than protecting each sheet individually, but it means all sheets have the same password and the same locked/unlocked cells. If you need different settings for different sheets, protect them one at a time instead.
Frequently Asked Questions
Can I protect a sheet without a password?
Yes. When you click Protect Sheet, the password field is optional. If you leave it blank and click OK, the sheet is protected but anyone can unprotect it. This stops accidental edits but not intentional ones. Use a password if you need to prevent someone from deliberately changing the sheet.
What happens if I forget the password to my protected sheet?
You can remove sheet protection with free online tools or scripts, which takes a few minutes. If you forget a workbook password, recovery is much harder — some third-party tools exist but are unreliable. For important files, store your password in a password manager or write it down in a secure location.
Can people still copy data from a protected sheet?
Yes. Sheet protection prevents editing and deletion, but it does not prevent copying. If you need to stop people from copying data, you need encryption or a different security method. Workbook protection with a password is more secure but still not encryption.
Does protecting a sheet slow down Excel?
No. Sheet protection has no effect on performance. Excel runs at the same speed whether a sheet is protected or not.
Can I protect a sheet in Google Sheets the same way?
Google Sheets has a similar feature called Protect sheets and ranges, found in the Data menu. The process is slightly different — you select the range first, then set protection — but the result is the same. Google Sheets does not support workbook-level passwords the way Excel does.