-->
Last Updated: Sun Apr 06 2025
In 3 simple methods, this guide will show you how to lock cells in Excel to protect your data from accidental edits.
Whether you need to lock all cells, specific cells, or just formula cells, you’ll learn how to secure your spreadsheet in just a few minutes.
Let’s dive in!
Methods:
By default, Excel has all cells set to ‘locked’. However, this setting only works after you protect the sheet. Follow these steps to lock all cells at once:
Press CTRL + A to select all the cells in the worksheet. Alternatively, you can click the small triangle in the top-left corner of the sheet (between the row and column headers).
Now, go to the Review tab on the top ribbon of Excel.
Click Protect Sheet.
A pop-up will appear. You can set a password here if you want extra security. Enter a password (optional) and click OK.
Now, your entire worksheet is locked, preventing any edits until you unprotect the sheet.
To make changes again, simply go to Review → Unprotect Sheet and enter the password if you set one.
Finished!
If you want to lock only certain cells while keeping others editable, follow these steps:
Press CTRL + A to select all the cells in your worksheet.
Right-click and choose Format Cells (or press CTRL + 1).
In the Protection tab, uncheck the ‘Locked’ checkbox. Then, click OK. This will unlock all cells in the sheet.
Finally, to activate the locking, go to Review → Protect Sheet.
If you want, you can add a password here (optional).
Click OK.
Now, only the specific cells you selected are locked. The rest of the worksheet remains editable.
Finished!
Locking cells that contain formulas can protect your calculations from accidental changes. Follow these steps to lock only the formula cells:
Press CTRL + A to select all cells.
Right-click and choose Format Cells (or press CTRL + 1).
In the Protection tab, uncheck the ‘Locked’ box. Then click OK.
To finish, go to Review → Protect Sheet.
Set a password if needed, then click OK.
Now, your formula cells are locked and protected. If you choose the hidden option, the formulas won’t even show up in the formula bar.
Finished!
What if I forget the password?
If you forget the password, you can't unprotect the sheet. Use a backup copy or specialized third-party tools to recover it. Be cautious with third-party software for security reasons.
Can I lock only certain parts?
Yes, follow the steps to lock specific cells and protect the sheet.
Are charts protected too?
Yes, protecting a worksheet generally includes charts. Adjust protection settings in the Protect Sheet dialog to customize permissions.