Excel TVExcelTV

How to Lock Cells in Excel

Updated
Illustration of Excel sheet protection controls and locked cells

If you want the short version: lock the cells you want to protect, leave the editable cells unlocked, and then apply sheet protection. If you need to protect cells specifically, the real workflow is still a two-step combination of cell formatting and worksheet protection. That’s why a clean template matters: the easier it is to spot input cells, the easier it is to keep the rest of the model safe.

Illustration of Excel sheet protection controls and locked cells

Sourced stat: Microsoft’s Protection and security in Excel article groups Excel protection into 3 levels — file-level, workbook structure, and sheet protection — and says the file-level area has 5 choices.

Quick Answer

To lock cells in Excel, first set the cells you want editable to Unlocked, then leave formula cells or sensitive cells as Locked, and finally go to Review > Protect Sheet. That sequence is what actually enforces the lock. If you skip the final step, Excel will still let users edit every cell.

What “Lock Cells” Means in Excel

Locking cells in Excel does not mean the file is encrypted or the workbook is fully secured. It means Excel will prevent edits to selected cells on a protected worksheet. That distinction matters because the Locked checkbox is just a setting until you apply sheet protection.

Here’s the practical breakdown:

GoalWhat to use
Protect formulas and calculated cellsLocked cells + Protect Sheet
Lock specific cells but keep input areas openUnlock the input cells first, then protect the sheet
Let selected people edit certain rangesAllow Users to Edit Ranges
Stop structural changes like adding or deleting tabsProtect Workbook
Remove protection laterHow to Unprotect an Excel Sheet

That table is the fastest way to choose the right protection layer. Most people searching for how to lock cells in Excel actually want worksheet protection, not workbook protection or file encryption.

How to Lock All Cells Except Input Cells

The most common setup is to lock formulas while leaving data-entry cells open. The cleanest method is to unlock the whole sheet first, then lock only the cells you want protected, and finally turn on Protect Sheet. That gives you a simple model where users can type in one area without accidentally breaking formulas elsewhere.

Step 1: Select the entire worksheet

Click the square in the top-left corner where the row numbers and column letters meet, or press Ctrl+A. This selects every cell in the sheet so you can standardize the starting point. I always begin here because Excel sheets often inherit mixed lock states from templates or copied workbooks.

Step 2: Clear the Locked setting for the cells that should stay editable

Right-click the selected sheet and choose Format Cells. Go to the Protection tab and clear the Locked checkbox. This unlocks every cell on the worksheet.

That sounds backwards, but it is the safest way to build a partial lock. Once everything is unlocked, you can selectively relock only the cells that must stay protected.

Step 3: Select the cells you want to lock

Now highlight the formula cells, heading cells, totals, or any other cells you do not want people changing. This is where “lock specific cells” becomes useful. Instead of protecting the whole sheet blindly, you are protecting only the cells that matter.

If you want, you can select non-adjacent cells with Ctrl on Windows or Command on Mac. That makes it easier to lock scattered formula areas without changing the rest of the layout.

Step 4: Mark those cells as Locked

Open Format Cells > Protection again and check Locked. At this point, the cells are marked for protection, but users can still edit them because the worksheet is not protected yet.

This is one of the easiest Excel protection mistakes to miss. People assume the lock is active as soon as they tick the box, but the box only becomes enforceable after the next step.

Step 5: Protect the sheet

Go to Review > Protect Sheet. Excel will ask what users should still be allowed to do. In many cases I leave Select unlocked cells enabled and turn off everything else that is not needed.

Add a password if the workbook is shared broadly or if you want a simple barrier against accidental changes. Then click OK and re-enter the password if Excel asks for confirmation.

Step 6: Test the sheet before you send it

Try editing a locked cell and an unlocked cell. The locked cell should reject typing, while the unlocked cell should behave normally. I always test this before I share the file because it catches mistakes like locking the wrong range or forgetting to protect the sheet entirely.

How to Lock Specific Cells in Excel

If you only want to lock a few cells, the process is the same, just narrower. Leave the whole sheet unlocked at first, select the exact cells you want to protect, mark them as Locked, and then apply sheet protection. That gives you cell-level control without turning the whole worksheet into a rigid form.

This approach is ideal for models where users should edit assumptions, dates, or inputs but not formulas, labels, or summary totals. It also works well for checklists and dashboards where only a handful of cells should ever change.

A practical example

Imagine a monthly budget sheet with three areas:

  • Income inputs that staff can edit
  • Formula cells that calculate totals automatically
  • Summary cells that should never be touched

In that setup, I unlock the input cells, lock the formula and summary cells, and then protect the sheet. The result is a flexible workbook that still preserves the core logic behind the numbers.

When selective locking works best

Selective locking is best when the workbook has a clear input/output structure. If every cell in the worksheet behaves differently, the user experience becomes messy. In that case, I usually simplify the layout first, then lock the cells in a way that matches how people actually use the file.

How to Allow Editing Ranges Without Unprotecting Everything

If you want collaborators to edit only certain sections, use Allow Users to Edit Ranges. This is the best middle ground between full worksheet protection and no protection at all. It lets you keep the sheet locked while still granting access to approved ranges.

The workflow

  1. Go to Review > Allow Users to Edit Ranges.
  2. Create a new range and name it clearly.
  3. Select the cells that should remain editable.
  4. Set a password or user permission for that range.
  5. Protect the sheet as usual.

This is especially useful in team environments. For example, you can let one person update input cells, another person adjust assumptions, and everyone else stay out of the formula areas.

Why ranges are better than leaving the sheet open

Editable ranges give you precision. Instead of removing protection from the whole sheet just because one team member needs access to one section, you can grant access only where it is needed. That keeps the worksheet safer and also reduces accidental overwrites.

Workbook Protection vs Cell Locking

Cell locking and workbook protection solve different problems, so it helps to separate them clearly. Locking cells protects data inside a sheet. Workbook protection protects the workbook structure itself. If you need to prevent someone from adding, deleting, moving, or renaming sheets, locking cells is not enough.

I usually think of it like this: cell locking is for content control, and workbook protection is for structure control. In many spreadsheets, both are useful at the same time. For example, a financial model might use locked cells on each sheet and workbook protection to stop tab-level changes.

If you are deciding between them, start with the user behavior you want to stop. If the issue is formula edits, lock cells. If the issue is sheet-level tampering, use Protect Workbook.

How to Unprotect and Change Locked Cells Later

To change a locked worksheet later, go to Review > Unprotect Sheet and enter the password if one was set. Once the sheet is open again, you can clear or change the Locked setting on any cells you want to update. If you need a full walk-through of that reverse workflow, see How to Unprotect an Excel Sheet.

That reverse step is important because many people lock a sheet perfectly the first time and then get stuck when they need to revise the layout. Unprotecting does not erase the protection setup; it simply lets you edit the formatting and then reapply the lock.

My re-lock checklist

After I finish edits, I always do the same three things:

  • Reapply the correct Locked / Unlocked settings
  • Protect the sheet again
  • Test both an editable cell and a protected cell

That habit prevents the most common spreadsheet problem I see: a workbook that looks protected but still has one or two editable cells exposed.

Common Mistakes When Locking Cells in Excel

The biggest mistake is forgetting to protect the sheet after marking cells as Locked. The second biggest mistake is locking the wrong cells and leaving the input cells closed, which makes the workbook frustrating to use. A third common issue is assuming workbook protection and sheet protection are the same thing.

Here are the ones I see most often:

  • Locked without Protect Sheet: nothing actually changes
  • Protected the wrong range: users cannot enter data where they should
  • Used workbook protection instead of sheet protection: formulas remain editable
  • Forgot to test: a broken form reaches coworkers or clients
  • Skipped the unprotect workflow: later edits become unnecessarily painful

If you avoid those five mistakes, you will get a reliable lock setup on the first try most of the time.

Best Practices for Shared Excel Files

The best Excel protection setup is the one that matches how people actually work. I like to keep inputs obvious, formulas hidden from casual edits, and permissions as narrow as possible. That makes the file easier to use and much harder to break.

A few habits make a big difference:

  • Use a clear color scheme for input cells versus formula cells
  • Add a short note at the top of the sheet explaining where users can type
  • Protect workbook structure if tabs should stay fixed
  • Use separate passwords for different workbooks, not one reused password
  • Revisit permissions when the team or workflow changes

Those small adjustments turn a protected sheet from a frustrating barrier into a clean, controlled workflow.

FAQ

If you are still deciding how to lock cells, these questions cover the most common edge cases: why the Locked setting alone does not work, whether passwords are required, how to handle rows or columns, when to use Allow Users to Edit Ranges, and how Hidden differs from Locked.

Why can I still edit a cell after checking Locked?

Because Excel’s protection model has 3 levels, and Locked only becomes enforceable after you apply sheet protection. Until you choose Review > Protect Sheet, the checkbox is just a stored setting rather than an active restriction.

Can I lock cells in Excel without a password?

Yes. Microsoft’s file-level protection area has 5 choices, and password-to-open is only 1 of them. For cell locking, you can still protect a sheet without a password if you mainly want to stop casual edits.

How do I lock rows or columns instead of individual cells?

Treat the row or column as 1 range: select it, mark it Locked or Unlocked, and then protect the sheet. That keeps the workflow to 2 steps after selection, which is usually faster than managing scattered cells one by one.

What if I only want some users to edit certain cells?

Use Allow Users to Edit Ranges to keep 1 protected sheet open only for approved ranges. That gives you a narrower permission model than unlocking the whole worksheet and is easier to manage in shared files.

Does locking cells hide the formulas?

No. Locked and Hidden are 2 separate checkboxes in the Protection tab, so you can protect editing without hiding the formula, or hide the formula without changing the lock state.

Written by

Allen Hoffman

Contributor, Excel TV

  • Lookup Functions
  • Data Manipulation
  • Keyboard Shortcuts
  • Workflow Efficiency
Allen Hoffman is a contributor to Excel TV focused on practical Excel techniques for everyday data work. His tutorials cover topics including lookup functions, data manipulation, cell formatting, keyboard shortcuts, and workflow efficiency. Allen's writing aims to make common Excel tasks clearer and faster, with step-by-step guidance suited to analysts and professionals who use Excel regularly in their work.

Read more articles by Allen Hoffman

Editorial standards

Fact Checking & Editorial Guidelines

Every article on Excel TV is held to a published editorial standard. The goal: accurate, current, and useful — without filler.

  1. Expert review.Drafts on technical Excel topics are reviewed by a contributor with hands-on, working knowledge of the feature being covered.
  2. Source validation.Claims about Excel behavior are tested in current Microsoft 365 builds. Third-party product claims are sourced from the vendor's own documentation.
  3. Disclosure.Affiliate links, sponsorships, and any commercial relationships that influenced a piece are disclosed in-line and at the foot of the article.
  4. Updates.Articles are revisited when Microsoft ships changes that affect the content. The most recent revision date is shown on every post.

Spot a problem? Email editor@excel.tv and we will look at it.

Subject-matter review

Reviewed by Subject Matter Experts

Technical Excel articles are reviewed by contributors with verifiable, hands-on experience in the topic — not generalist editors.

  • Qualified reviewers.Reviewers include Microsoft Excel MVPs, working business-intelligence practitioners, and Excel TV editorial staff. See each author's page for credentials.
  • Current to a known Excel build.Procedural articles state which Excel version they were validated against. Where Microsoft has since changed behavior, the article carries an inline update note.
  • Clarity check.Reviewers verify steps are reproducible by a reader at the assumed skill level — not just technically correct in a vacuum.

Want to contribute or review for Excel TV? See the about page.