How to Lock Cells in Excel & Google Sheets
Written by
Reviewed by
This tutorial demonstrates how to lock cells in Excel and Google Sheets.
Lock All Cells
In Excel, you can lock all cells for editing. To do this, password protect a sheet. Read on for more about locking cells. By default, all cells in Excel have the Locked property turned on.
- To confirm the locked property, select all cells (click the arrow in the upper left corner of the gridlines), right-click anywhere in the selected area, and choose Format Cells…
- In the Format Cells dialog box, go to the Protection tab. Here, you can see that Locked is checked. This means that, if you protect a sheet, all cells are locked for editing.
- Now you can protect the sheet. In the Ribbon, go to Review > Protect Sheet.
- In the Protect Sheet window, type in a Password to unprotect sheet and click OK. Once you’ve protected the worksheet, users can only select cells.
- In the Confirm Password pop-up window, type the same password in again and click OK.
Now, if you try to edit any cell in the sheet, you get a message that the sheet is protected and can’t be edited.
To be able to edit cells again, unprotect the sheet.
Lock Specific Cells
To lock only a specific range of cells (for example, B1:B3), follow these steps:
- Select all cells (click on the arrow in the upper-left corner or use CTRL + A), right-click anywhere in the selected area, and choose Format Cells…
- In the Format Cells window, go to the Protection tab, uncheck Locked, and click OK.
- Now, select the cells you want to lock (here, B1:B3), right-click anywhere in the selected area, and choose Format Cells…
- In the Format Cells window, go to the Protection tab. Tick Locked, and then click OK.
As a result, you can edit all cells except B1:B3 which are locked.
In the picture above, you can see that cell B4 is edited, but when you try to edit any cell in the range B1:B3, you get the error message.
Note that you also have the option to lock only formatting.
Lock Cells in Google Sheets
You can also lock cells for editing in Google Sheets, using protected ranges.
- Select all cells, right-click anywhere in the selected area, and choose Protect range.
- In the window on the right side, choose Set permissions.
- Here, you can choose to only show a warning, or to specify who can edit the range. Then click Done.
Now, only specified users can edit the range, while for all others, cells are locked for editing.
Note: To see, instead, how to lock a cell reference, see Freeze Cell in Formula or How to Anchor a Cell.