How to Protect Cells in Excel: Lock Only the Cells That Matter
Learn how to protect cells in Excel: unlock input cells, lock the rest, protect the sheet, allow edit ranges, hide formulas, and what protection can't do.
To protect cells in Excel, unlock the cells people should be able to edit, leave the cells you want to protect locked, and then turn on Review > Protect Sheet. Cells are locked by default, but that setting has no effect until the sheet is protected, which is why “locking” a cell on its own seems to do nothing.
Below are the exact steps, the options worth knowing in the Protect Sheet dialog, and the limits you should understand before relying on protection. Steps reflect Microsoft’s documentation as of October 2026; menu names can shift slightly between Excel versions.
How cell protection actually works
Excel protection is a two-part system, as Microsoft’s Protect a worksheet article describes it:
- Each cell has a Locked property (on the Protection tab of Format Cells). It is switched on for every cell by default.
- Protect Sheet enforces that property. Once the sheet is protected, locked cells can’t be edited, while unlocked cells stay editable.
So the real job is usually the reverse of what people expect: you don’t lock the cells you want to protect, you unlock the ones you want people to type into.
Protect specific cells: step by step
This is the standard method from Microsoft’s Lock cells to protect them guide, and independent tutorials such as GoSkills describe the same sequence.
Option A: protect a few cells, leave the rest editable
- Select the entire sheet (click the triangle in the top-left corner where the row and column headers meet).
- Go to Home > Format > Format Cells, open the Protection tab, and clear the Locked check box. Click OK.
- Select only the cells you want to protect, such as formulas or headers.
- Open Format Cells > Protection again and tick Locked. Click OK.
- Go to Review > Protect Sheet.
- Choose what users may still do (see the options below), optionally enter a password, and click OK.
Option B: protect most of the sheet, leave a few input cells open
This is the more common case for forms, budgets and templates.
- Select the cells people should be allowed to edit.
- Open Format Cells > Protection and clear Locked.
- Go to Review > Protect Sheet, set your options and an optional password, and click OK.
Everything you didn’t unlock stays protected. Microsoft notes that users can press Tab to jump between unlocked cells on a protected sheet, which makes this setup pleasant for data entry.
The Protect Sheet options worth knowing
The Protect Sheet dialog has a list headed “Allow all users of this worksheet to”. Ticking a box lets everyone perform that action even while the sheet is protected. According to Microsoft, the list includes:
| Option | What it allows |
|---|---|
| Select locked cells | Clicking into locked cells (on by default) |
| Select unlocked cells | Clicking into unlocked cells (on by default) |
| Format cells, columns, rows | Changing formatting without unlocking content |
| Insert / delete rows and columns | Structural changes to the grid |
| Sort | Sorting data |
| Use AutoFilter | Filtering with existing filter buttons |
| Edit objects | Changing charts, shapes and other objects |
Two practical notes:
- Sorting and filtering are off unless you tick them, a point several tutorials flag because it surprises people.
- Microsoft’s documentation also notes that users can’t sort ranges that contain locked cells on a protected sheet, even if Sort is allowed. If you want a sortable table, unlock that whole range.
Let specific ranges stay editable with Allow Edit Ranges
If different people should edit different parts of a protected sheet, use Allow Edit Ranges in desktop Excel for Windows, as described in Microsoft’s Lock or unlock specific areas of a protected worksheet:
- Make sure the sheet is not protected yet.
- Go to Review > Allow Edit Ranges, then select New.
- Give the range a title and enter the cell reference it covers.
- Optionally set a range password. Anyone who enters it can edit that range while the rest of the sheet stays locked.
- Optionally use Permissions to name specific users who can edit without a password.
- Click OK, then protect the sheet with Review > Protect Sheet.
The per-user permissions rely on Windows accounts. Microsoft’s guidance says the computer has to be part of a domain, so for most home and small-team setups the range-password option is the practical one.
Hide formulas as well as locking them
Locking a formula cell stops edits, but people can still see the formula in the formula bar. To hide it, follow Microsoft’s Display or hide formulas steps:
- Select the cells whose formulas you want to hide.
- Go to Home > Format > Format Cells, open the Protection tab, and tick Hidden.
- Go to Review > Protect Sheet and keep Protect worksheet and contents of locked cells selected.
Like Locked, Hidden only takes effect once the sheet is protected. Microsoft notes that hiding a formula also prevents its cells from being edited. To show formulas again, unprotect the sheet and clear the Hidden box.
Protecting cells in Excel for the web
In Excel for the web, Microsoft’s Protect a worksheet article points to a different control: Review > Manage Protection. In the Manage Protection pane, switch on Protect sheet. The settings in the pane’s Options section only apply while that switch is on, and the whole sheet is locked by default, so unlock the cells people need to edit.
Some third-party guides report that the web version doesn’t always respect unlock settings made in desktop Excel. I couldn’t confirm that in Microsoft’s documentation, so treat it as unverified. If cells behave oddly in the browser, check the setup in the desktop app.
Sheet, workbook and file protection compared
These three features are easy to confuse. Microsoft’s Protect a workbook article explains that they do different jobs:
| Feature | Where | What it protects |
|---|---|---|
| Protect Sheet | Review > Protect Sheet | Cell contents and formatting on one sheet |
| Protect Workbook | Review > Protect Workbook | Structure: adding, moving, deleting, hiding, unhiding or renaming sheets |
| File password (encryption) | File > Info > Protect Workbook | Whether someone can open the file at all |
If you want cells safe and don’t want someone to delete the whole tab, use sheet protection together with workbook protection.
Unprotecting a sheet and password caveats
To make changes later, go to Review > Unprotect Sheet and enter the password if you set one.
Be careful with passwords:
- A password is optional, but without one anyone can unprotect the sheet in two clicks.
- Microsoft cannot retrieve a forgotten password. In a Microsoft Q&A thread, Microsoft’s answer is that protection can only be removed with the correct password, and it suggests recovering an earlier copy from a backup or OneDrive/SharePoint version history.
- Passwords are case-sensitive.
Finally, Microsoft is explicit that worksheet-level protection isn’t intended as a security feature. It stops accidental overwrites by colleagues and keeps templates intact. It isn’t a way to keep data confidential. For sensitive data, encrypt the file with a password or limit who has access to it.
Quick checklist
- Unlock input cells first (Format Cells > Protection > clear Locked).
- Protect the sheet (Review > Protect Sheet).
- Tick Sort or Use AutoFilter if people need them.
- Tick Hidden on formula cells if you don’t want them visible.
- Add Protect Workbook if the sheet structure matters too.
- Store any password somewhere safe, because it can’t be recovered.
Free apps worth trying
SponsoredSponsored links. Installing through them can earn us a commission, at no cost to you. Apps are free to download; some offer optional in-app purchases.
Frequently asked questions
Why can I still edit my locked cells in Excel? +
The Locked setting does nothing until the sheet itself is protected. Every cell is locked by default, but you only get the effect after you go to Review > Protect Sheet.
Can I protect just one cell and leave the rest of the sheet editable? +
Yes. Select the whole sheet and clear the Locked box in Format Cells, then select only the cell you want to protect, tick Locked, and protect the sheet. Everything else stays editable.
What happens if I forget the sheet protection password? +
Microsoft says it cannot retrieve forgotten passwords, and protection can only be removed with the correct one. Your best options are a backup or an earlier version from OneDrive or SharePoint version history, so store the password somewhere safe.
Is a protected sheet secure enough for confidential data? +
No. Microsoft states that worksheet-level protection isn't intended as a security feature; it prevents accidental changes. To stop people opening a file at all, use file-level password protection instead.
Sources
- Lock cells to protect them in Excel (Microsoft Support) (support.microsoft.com)
- Protect a worksheet (Microsoft Support) (support.microsoft.com)
- Lock or unlock specific areas of a protected worksheet (Microsoft Support) (support.microsoft.com)
- Display or hide formulas (Microsoft Support) (support.microsoft.com)
- Protect a workbook (Microsoft Support) (support.microsoft.com)
- How do I access an Excel workbook protected with a password I created and I forgot the password? (Microsoft Q&A) (learn.microsoft.com)
- How to lock cells in Excel (GoSkills) (goskills.com)