How to Lock a Row in Excel

This guide treats “lock a row in excel” the way busy spreadsheet users actually want it: answer first, then the reasoning. It is written for Excel but calls out every place Google Sheets differs, and the platform toggle at the top switches all shortcuts between Windows and Mac so nothing here assumes the keyboard you are not on.

Exact answer

In Excel: every cell is already marked Locked, but locking only takes effect once you turn on Review ▸ Protect Sheet; to lock just some cells, first unlock the rest via Format Cells ▸ Protection (uncheck Locked), then Protect Sheet.

Annotated stepsExcel
1

Select all cells, open Format Cells (Ctrl+1) ▸ Protection, and confirm Locked is ticked (it is by default).

2

Select only the cells people should still edit, reopen Format Cells ▸ Protection, and uncheck Locked.

3

Go to Review ▸ Protect Sheet, choose what users may still do, and set a password if you want.

4

Click OK — the locked cells are now read-only while the unlocked ones accept input.

Ctrl+CthenCtrl+Shift+V+Cthen+Ctrl+VPaste values · WindowsMac

What this does

The mechanism surprises most people: in a new sheet every cell already carries the Locked attribute, yet that attribute does nothing until you protect the sheet. So locking works in two layers. The Locked checkbox under Format Cells ▸ Protection marks which cells should be frozen, and Review ▸ Protect Sheet is the switch that actually enforces it. To make only some cells uneditable, you unlock the ones people should still type in (uncheck Locked for them), then Protect Sheet so the still-locked cells become read-only. Most people learn this as a sequence of clicks and forget it by next week; learning it as a pattern instead is what lets you apply it to the next, slightly different version of the problem without starting from scratch. That is the difference this page is trying to make. For “lock a row in excel”, the reliable version is a short checking loop, not just the first command that appears to work. Run it on a deliberately small range first, watch how the affected rows change, and only then apply the same setup to the full sheet. When this is a ribbon command, the selection matters more than the button: confirm the range, apply the command, then spot-check the output before saving. That is what makes a layout choice that keeps the sheet readable and sortable useful in real work: repeatable, auditable, and not dependent on memory or luck.

A worked example

A form has input cells in column B and a calculated formula in column C that must not be touched. Select B2:B20, open Format Cells (Ctrl+1) ▸ Protection, and uncheck Locked — those input cells are now exempt. Leave column C as-is (still Locked). Now Review ▸ Protect Sheet, optionally set a password, and click OK. People can type freely in column B, but any attempt to edit the formula in C2 is refused with "the cell is protected". Lock cells when you are handing a sheet to other people and want them to fill in some fields without breaking your formulas, headers or layout — budget templates, data-entry forms, shared trackers. It guides input to exactly the right places while keeping the working parts of the model safe. One habit worth forming early: name the cells that hold your inputs, so the formula reads in plain language instead of a string of cell addresses. A reviewer — or you in three months — can then follow the logic without decoding what B7 and D2 were supposed to mean, which is most of what makes a sheet maintainable.

In Google Sheets

Google Sheets handles this almost identically to Excel. The formula syntax above is the same, and the menu lives under a slightly different label rather than a ribbon tab. Use the platform toggle at the top of the page to switch every keyboard shortcut between Windows and Mac, and expect at most cosmetic differences in naming. Nothing on this page is behind a login: the tool runs entirely in your browser, the formula is shown in full with one-click copy, and the steps work the same on Windows and Mac. That is the whole promise here — the exact answer, a way to prove it on your own numbers, and just enough context to make it stick. Treat “lock a row in excel” as a small building block rather than a chore. Once the inputs sit in their own cells and the formula reads from them, the same setup answers a dozen related questions with a tweak, and Excel keeps every dependent figure current as the data changes. The tool above is there so you can rehearse and verify before committing anything to a real workbook; the steps and worked example are there so the logic sticks. Get it right once and it stops costing you time — it starts saving it, every time the question comes back around.

Common mistakes

  • Ticking Locked and expecting it to work without protecting the sheet — the Locked attribute does nothing until Protect Sheet is on.
  • Forgetting that all cells start Locked, so protecting the sheet without unlocking inputs freezes the entire sheet.
  • Unlocking the cells you meant to protect by mistake — Locked must stay ticked on the formulas you want read-only.
  • Confusing this cell-level locking with file encryption; locking controls editing, not whether the file opens.

Frequently asked questions

Why can I still edit a "locked" cell?

Because the sheet is not protected yet. The Locked attribute is dormant until you turn on Review ▸ Protect Sheet, which is what actually enforces it.

How do I lock only the formula cells and leave inputs open?

Unlock the input cells (Format Cells ▸ Protection ▸ uncheck Locked) while leaving the formulas Locked, then Protect Sheet — only the still-locked formulas become read-only.

Do I have to set a password to lock cells?

No. Protect Sheet works without a password; a password simply stops others from unprotecting the sheet and undoing your locks.

Other ways people ask this

People reach this page typing “how to lock rows in excel”, “how to lock row in excel”, “how do i lock a row in excel” and “how do you lock a row in excel”, among other phrasings; whichever wording you used, the fix above is the one you want.

Platform & version notes

  • If you are on a Mac, nothing here changes except the modifier key: swap Ctrl for ⌘ in every shortcut, and use the Windows/Mac toggle at the top of the page so the keystrokes shown match the keyboard in front of you.

How is it different on a Mac?

Only the keys. Press ⌘ where Windows uses Ctrl; the menus, formulas and result for "lock a row in excel" are the same on macOS as on Windows.

Why do people search for this in so many different ways?

Because the same task has many names. “how to lock rows in excel”, “how to lock row in excel”, “how do i lock a row in excel” all point at the one operation explained on this page, which is why they all lead here.