Locking cells in Excel takes two stages: apply the Locked formatting to the cells, then turn on Protect Sheet from the Review tab. The formatting alone does nothing on an unprotected sheet. These steps work in Microsoft 365 Excel, Excel 2021, and Excel 2019 on Windows; Excel for Mac differs only in the dialog path.

Lock Cells in Excel With the Format Cells Dialog

  1. Select the cells or ranges you want to lock. Hold Ctrl and click to add nonadjacent cells, or Ctrl + A to take the whole sheet.
  2. Go to the Home tab and click the small Alignment Settings arrow in the lower-right corner of the Alignment group to open Format Cells. The Ctrl + 1 shortcut opens the same dialog.
  3. Open the Protection tab and confirm Locked is checked, then click OK. Every cell carries this formatting by default, so nothing visibly changes yet.
  4. Switch to the Review tab and click Protect Sheet in the Protect group.
  5. Set a password if you want one, choose what users may still do, and click OK. Excel confirms the sheet is protected by graying out most ribbon editing commands and blocking edits in locked cells.

Test it immediately: click a locked cell and type. Excel refuses the edit with a message that the cell or chart you're trying to change is on a protected sheet. If typing succeeds instead, the cell was unlocked before protection—select it, clear Locked in Format Cells, and reapply protection.

The full official walkthrough lives in Microsoft's guide to lock cells to protect them in Excel.

Unlock the Input Cells Before You Protect

The standard scenario is a form or tracker where users fill in a few columns while every formula stays fixed. Locking is on by default, so the real work is unlocking the entry cells.

  1. Select the cells users should be able to edit, such as the input range under a header row.
  2. Press Ctrl + 1, open Protection, and clear the Locked check box (Format > Cells > Protection on Mac, or Command + 1).
  3. Click OK, then reapply Review > Protect Sheet. Anything you unlocked stays editable; the rest is frozen against changes.

To unprotect the whole sheet later, click Review > Unprotect Sheet and enter the password if you set one. If you forgot it, Microsoft's official recovery guidance applies, and third-party password removal tools are not supported—treat a lost password as a real lockout and keep a copy of it somewhere safe before you hand the file out.

Common Blockers and Why a Cell Still Changes

Locked cells still accept edits

Typical causes: sheet protection was never turned on, protection was applied before you checked the cells, or the edit landed in an unlocked cell. Reapply Protect Sheet after confirming the Locked state of the exact range.

Formatting or sorting is refused

Protection by default blocks formatting changes, row and column insertion, and sorting ranges that contain locked cells. When you click Protect Sheet, the options dialog lets you allow Format cells, Insert rows, Sort, and Use AutoFilter without unlocking data—tick only what the workflow needs.

Locked cells don't stop workbook-level changes

Sheet protection is local to one worksheet. Deleting, moving, or renaming a sheet, or changing the workbook's structure, needs Review > Protect Workbook as well. Apply both when the file goes to other people.

Formulas are visible even when locked

Locking prevents changes, not viewing. To hide the formula text, select the formula cells, open Format Cells > Protection, and check Hidden before protecting the sheet. The Formula bar and cell then show results only.

Mac path differences

On Excel for Mac, use the Format menu > Cells (Command + 1) > Protection tab, then Review > Protect Sheet. The Locked default matches Windows. Microsoft documents this in lock cells in Excel for Mac.

Online and mobile limits

Excel for the web and the mobile apps let you enter and view data in protected sheets but offer no controls to create or change protection. Apply lock settings in the desktop app, save, and sync before sharing a link.

Lock Only the Formula Cells in a Budget or Tracker

When most of the sheet should stay open, invert the method: press Ctrl + A, open Format Cells > Protection, and clear Locked so everything starts editable. Then select just the formula columns, check Locked, and apply Protect Sheet. This keeps totals and lookups intact while the raw data stays free.

Frequently Asked Questions

Does locking a cell hide its contents?

No. Locking and sheet protection prevent edits, not reading. Check Hidden on the Protection tab if you need to conceal formula logic.

Can someone bypass cell locks by copying the sheet?

Copying to a new workbook drops worksheet protection, so the copied sheet is editable. Treat locking as a guard against accidents and casual changes, not as document-level security—use file encryption or a protected workbook for stronger control.

Why is the Locked checkbox grayed out?

Protection is already on. Click Review > Unprotect Sheet, make the change, then reapply protection so the new state takes effect.