ExcelReady
CourseFunction guidesBlog
Start freeStart learning for free
ExcelReady

Be Excel-ready before the interview. Hands-on practice in your browser, with instant feedback.

Learn

  • Course
  • Function guides
  • Blog

Product

  • Certificate

Company

  • Editorial policy
  • Contact
  • Terms
  • Privacy

© 2026 ExcelReady. All rights reserved.

  1. Blog
  2. Productivity
  3. Protect a Sheet and Lock Cells in Excel

Protect a Sheet and Lock Cells in Excel

By ExcelReady Team·Updated October 30, 2026·4 min read

The short answer

Every cell in Excel is locked by default, but locking only works once the sheet is protected. To lock formulas but let people type inputs, select the input cells, press Ctrl+1 (Mac: ⌘1), untick Locked on the Protection tab, then go to Review > Protect Sheet. Locked cells can then be viewed but not edited.

Key takeaways

  • All cells start as Locked; the setting does nothing until you turn on Review > Protect Sheet.
  • Unlock the input cells first (Format Cells > Protection > untick Locked), then protect the sheet.
  • Tick Hidden as well to hide formulas from the formula bar on a protected sheet.
  • Sheet protection prevents accidental edits; it is not security. Use Encrypt with Password to keep a file private.
  • Keep the password safe: Excel can't recover a lost protection password for you.
On this page+
  1. How locking and protection work together
  2. Step 1: Unlock the input cells
  3. Step 2: Protect the sheet
  4. Lock only the formulas
  5. Hide formulas from the formula bar
  6. Let some people edit some ranges
  7. How to unprotect a sheet
  8. Protect the workbook structure
  9. What sheet protection does not do
  10. Practise it

To lock cells in Excel, you need two steps: decide which cells stay editable by unlocking them, then protect the sheet. The surprise for most people is that every cell is already locked, but the lock does nothing until protection is on. This guide shows the full process on Windows and Mac, how to hide formulas, and what sheet protection can and can't do.

How locking and protection work together#

Each cell has a Locked setting, and it is on for every cell in a new workbook. On its own it changes nothing: you can still type anywhere. Once you turn on Protect Sheet, Excel blocks changes to every cell marked Locked, and lets people edit only the cells you unlocked.

So the job is always:

  1. Unlock the cells people should be able to change, such as inputs.
  2. Protect the sheet.

Here is an order form. Staff should enter quantities in column B, but the prices and formulas must not change.

ABCD
1ItemQtyPriceLine total
2Notebook104.50=B2*C2 → 45.00
3Pen251.20=B3*C3 → 30.00
4Folder82.75=B4*C4 → 22.00
5Tape63.15=B5*C5 → 18.90
6Total=SUM(D2:D5) → 115.90

Step 1: Unlock the input cells#

  1. Select the cells people should edit, here B2:B5. Our guide to selecting ranges fast shows keyboard ways to do this.
  2. Press Ctrl+1 on Windows or ⌘1 on a Mac to open Format Cells. (You can also right-click and choose Format Cells.)
  3. Click the Protection tab.
  4. Untick Locked and click OK.

Nothing visible changes yet. That's normal.

Step 2: Protect the sheet#

  1. Go to Review > Protect Sheet.
  2. Type a password if you want one. It's optional: without a password, anyone can click Unprotect Sheet, but the protection still stops accidental changes.
  3. In the list, choose what people may still do. Select locked cells and Select unlocked cells are ticked by default. You can also allow actions such as Format cells, Insert rows, Sort and Use AutoFilter.
  4. Click OK, and confirm the password if you set one.

Now try typing in D2: Excel shows a message that the cell is on a protected sheet. Typing in B2 still works, and the totals update.

A useful side effect: on a protected sheet, Tab moves between unlocked cells only, so people filling in a form jump straight from input to input.

Lock only the formulas#

On a big sheet, unlocking inputs one block at a time is slow. It's often quicker to unlock everything, then lock only the formulas:

  1. Select the whole sheet with Ctrl+A (Mac: ⌘A), press Ctrl+1 (Mac: ⌘1) and untick Locked.
  2. Select only the formula cells. Go To Special does this in one step: press F5, click Special, choose Formulas and click OK. See our guide to Go To Special for the details.
  3. Press Ctrl+1 (Mac: ⌘1) again and tick Locked.
  4. Protect the sheet.

Hide formulas from the formula bar#

To stop people seeing how a result is calculated, tick Hidden as well as Locked on the Protection tab, then protect the sheet. The cell still shows its result, but the formula bar stays empty when the cell is selected.

Hiding formulas doesn't make them secret. Anyone who unprotects the sheet sees them again, so use it to keep a sheet tidy, not to protect sensitive logic.

Let some people edit some ranges#

On Windows, Review > Allow Edit Ranges lets you give a range its own password while the rest of the sheet stays locked. For example, the sales team can edit their targets with one password, while only the finance team can change the prices. Set up the ranges first, then protect the sheet; the ranges have no effect until protection is on.

For most simple forms, unlocking the input cells is enough. Use Allow Edit Ranges only when different people need to edit different parts.

How to unprotect a sheet#

Go to Review > Unprotect Sheet. If you set a password, Excel asks for it. Make your changes, then protect the sheet again.

Microsoft can't recover a lost sheet protection password. Store it somewhere safe, such as your organisation's password manager, and share it with whoever maintains the file.

Protect the workbook structure#

Sheet protection stops changes to cells. It doesn't stop someone deleting, renaming or moving a whole sheet. For that, use Review > Protect Workbook, which protects the workbook's structure: no adding, deleting, renaming, moving, hiding or unhiding sheets.

This is also how you stop people from simply unhiding a sheet you hid. Our guide to hiding and unhiding rows and columns covers hiding in more detail.

What sheet protection does not do#

Sheet protection is designed to prevent accidental edits, not to keep data private. Know its limits:

  • It doesn't encrypt the file. Anyone who can open the file can read every value. To keep a file private, use File > Info > Protect Workbook > Encrypt with Password on Windows. That password is needed to open the file at all.
  • It doesn't stop copying. People can copy cells they can select and paste them into another workbook.
  • Some features stop working. On a protected sheet, people can't insert rows, sort or filter unless you allowed it in the Protect Sheet dialog.

If something seems broken on a shared file, check whether the sheet is protected before anything else. The Review tab shows Unprotect Sheet when protection is on. To undo an accidental edit on an unprotected sheet, see edit, undo and redo without the mouse, and to move around a form quickly, our guide to navigating Excel with the keyboard helps.

Practise it#

Try the exercise on this page to build the locked total for the order form. Then practise editing, clearing and undoing changes in a live spreadsheet, the everyday skills you need before you lock a sheet for others.

Try it yourself

This is a live spreadsheet. Type the formula in the green cell and press Enter.

In this order form, only Qty (column B) will be unlocked. The line totals in column D and the grand total are locked formulas. In D6, add up the line totals with =SUM(D2:D5).

fx
ABCDE
1
Item
Qty
Price
Line total
2
Notebook
10
4.5
45
3
Pen
25
1.2
30
4
Folder
8
2.75
22
5
Tape
6
3.15
18.9
6
Total
7
8
9

Tip: SUM needs one range: the line totals from D2 down to D5.

Practise this in a lesson

LessonFreeEdit, clear and undoReplace a cell, fix part of a cell without retyping it, cancel an edit, clear cells and undo mistakes.

Frequently asked questions

How do I lock specific cells in Excel?

+

Select all cells and untick Locked in Format Cells > Protection. Then select only the cells to lock, tick Locked, and turn on Review > Protect Sheet.

Why can I still edit locked cells?

+

Locking has no effect until the sheet is protected. Go to Review > Protect Sheet, optionally add a password, and click OK.

How do I unprotect a sheet in Excel?

+

Go to Review > Unprotect Sheet. If the sheet was protected with a password, Excel asks for it.

How do I hide formulas in Excel?

+

Select the formula cells, press Ctrl+1 (⌘1 on a Mac), tick Hidden on the Protection tab, then protect the sheet. The results still show, but the formula bar stays empty.

Can people still sort and filter on a protected sheet?

+

Only if you allow it. In the Protect Sheet dialog, tick Sort and Use AutoFilter. Sorting still needs the cells being sorted to be unlocked.

Sources

  • Protect a worksheet - Microsoft Support
  • Lock or unlock specific areas of a protected worksheet - Microsoft Support

Written and checked by the ExcelReady Team. First published October 30, 2026. The practice exercise runs in the same formula engine as our lessons. Found a mistake? Read our editorial policy or email hello@excelready.app.

On this page

  1. How locking and protection work together
  2. Step 1: Unlock the input cells
  3. Step 2: Protect the sheet
  4. Lock only the formulas
  5. Hide formulas from the formula bar
  6. Let some people edit some ranges
  7. How to unprotect a sheet
  8. Protect the workbook structure
  9. What sheet protection does not do
  10. Practise it

Keep reading

Productivity· 5 min read

Hide and Unhide Rows and Columns in Excel

To unhide rows in Excel, select the rows above and below the hidden ones, right-click a row number and choose Unhide. To unhide everything, select the whole sheet first. To hide rows, select them and press Ctrl+9 or right-click and choose Hide. Hidden rows still count in SUM; use SUBTOTAL(109,...) to total only the visible ones.

Productivity· 5 min read

Go To Special in Excel: Select Blanks, Formulas and More

Go To Special selects every cell of one kind at once, such as blanks, formulas, constants, errors or visible cells only. Press F5 (or Ctrl+G), click Special, choose the type and click OK. Select a range first to search only that range. It's also on Home > Find & Select > Go To Special.

Basics· 4 min read

Edit, Clear, Undo and Redo in Excel Without the Mouse

The edit cell Excel shortcut is F2 on Windows. On a Mac, press Control+U or fn+F2. It opens the cell with the cursor at the end, so you can fix part of it without retyping. Esc cancels an edit, Delete clears the selected cells, Ctrl+Z (⌘Z) undoes your last change and Ctrl+Y (⌘Y) redoes it.

Don't just read about Excel. Do it.

Practise real formulas in a live spreadsheet with instant feedback. The first lessons are free, with no download.

Start learning for free