How to Lock Cells in Excel & Google Sheets

Written by

Editorial Team

Reviewed by

Laura Tsitlidze

Last updated on September 12, 2023

This tutorial demonstrates how to lock cells in Excel and Google Sheets.

lock cells excel 3

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.

  1. 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…

lock cells excel 1

  1. 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.

lock cells excel 2

  1. Now you can protect the sheet. In the Ribbon, go to Review > Protect Sheet.

lock cells excel 3

  1. 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.

lock cells excel 4

  1. In the Confirm Password pop-up window, type the same password in again and click OK.

lock cells excel 5

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.

lock cells excel 6

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:

  1. 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…

lock cells excel 1

  1. In the Format Cells window, go to the Protection tab, uncheck Locked, and click OK.

lock specific cells 1

  1. Now, select the cells you want to lock (here, B1:B3), right-click anywhere in the selected area, and choose Format Cells…

lock specific cells 2

  1. In the Format Cells window, go to the Protection tab. Tick Locked, and then click OK.

lock specific cells 3

As a result, you can edit all cells except B1:B3 which are locked.

lock specific cells 4

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.

  1. Select all cells, right-click anywhere in the selected area, and choose Protect range.

google sheets lock cells 1

  1. In the window on the right side, choose Set permissions.

google sheets lock cells 2

  1. Here, you can choose to only show a warning, or to specify who can edit the range. Then click Done.

google sheets lock cells 3

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.

AI Formula Generator

Try for Free

See all How-To Articles