How to Lock an Excel Cell or Range and Protect the Sheet

How-to basics · Updated November 20, 2026

To lock a box (cell or range) in Excel, select it, open Format Cells with Ctrl+1, make sure Locked is checked on the Protection tab, and then choose Review > Protect Sheet. A cell’s Locked setting has no effect until you protect the worksheet. If you want to lock only that box while leaving other cells editable, unlock the rest of the sheet before protecting it.

What You’ll Need

  • Excel for Microsoft 365 on Windows and a workbook you can edit. The equivalent Format Cells shortcut on Mac is Command+1.
  • A clear idea of which cells should remain editable. If the sheet has formulas or headings, you may want to lock those while leaving input cells open.
  • Optionally, a password for sheet protection. A password helps prevent casual changes to protection settings, but worksheet protection is not a substitute for file encryption or secure sharing.

Step-by-Step

  1. Decide what should be editable. Excel marks cells as locked by default, but that setting only takes effect after you protect the sheet. If your goal is to stop changes to a particular range and you are happy for the rest of the sheet to be protected too, you can leave the other cells as they are. If people should be able to edit other areas, first unlock those areas as described in the next step.
  2. Unlock the cells people may change, if needed. To make most of the worksheet editable except for your target box, select the whole sheet by clicking the small triangle where the row numbers and column letters meet. You can also press Ctrl+A when the active cell is outside a data region; if it selects only a data region, click the triangle instead. Press Ctrl+1, open the Protection tab, clear the Locked checkbox, and choose OK. On a Mac, use Command+1. This removes the lock setting from the selected cells; it does not yet change what users can edit.
  3. Select the box you want to lock. Click its first cell and drag across the range, or click the Name Box to the left of the formula bar, type a reference such as B2:D8, and press Enter. For separate, non-adjacent ranges, hold Ctrl while selecting each range on Windows; on Mac, hold Command. Confirm the highlighted cells are the ones you intend to protect.
  4. Turn on the Locked setting for that selection. Press Ctrl+1 on Windows or Command+1 on Mac to open Format Cells. Select the Protection tab and check Locked. If the checkbox looks shaded or shows a mixed state, the selection contains cells with different settings; click the box until it is checked, then select OK. The cells are now marked as locked, but are not protected until you protect the sheet.
  5. Open the sheet-protection controls. Select the Review tab on the ribbon and choose Protect Sheet. Excel opens a dialog with a password field and a list of allowed actions. The exact dialog wording can vary slightly by build, but the key control is Protect worksheet and contents of locked cells. Make sure it is selected.
  6. Choose what users are allowed to do. Leave Select locked cells and Select unlocked cells checked if users should be able to move between both kinds of cells. You can clear Select locked cells to keep the cursor out of protected cells, though that may make the sheet less convenient to navigate. Other options, such as sorting or formatting, are separate permissions. Allow only actions users need, since some operations may still be unavailable if their results would change protected cells.
  7. Set a password only if appropriate. You can leave the password blank to protect against accidental edits without requiring a password to unprotect the sheet. If you enter one, use a password you can retrieve later and store it somewhere safe. Excel will ask you to confirm it. Losing the password can make it difficult to remove protection, so do not rely on a password you cannot recover.
  8. Test the result. Try typing into the locked box; Excel should block the change. If you unlocked other cells, try entering a value in one of them to confirm it remains editable. Save the workbook after checking. If the wrong cells are protected, choose Review > Unprotect Sheet, correct the Locked settings, and protect the sheet again.

For a simple case where the whole worksheet can be protected, skip the step that unlocks the rest of the sheet: select the target box, check Locked in Format Cells, then protect the sheet. Remember that Excel’s default Locked setting is already on for ordinary cells. You can still explicitly check it to confirm the target is locked.

Common Mistakes

  • Checking Locked but not protecting the sheet. This is the most common reason a cell still accepts edits. Locked is a cell property; Review > Protect Sheet activates it.
  • Protecting the sheet before unlocking input cells. Because cells start locked by default, protecting an untouched sheet normally makes all its cells uneditable. Unprotect it, unlock the cells intended for input, and protect it again.
  • Using Protect Workbook instead of Protect Sheet. Workbook protection controls some workbook-level structure, such as adding, moving, or deleting sheets. It does not replace worksheet protection for locking cell contents.
  • Assuming protection hides information. Sheet protection is mainly a way to prevent routine editing. It does not make confidential content safe from someone who can access the workbook.
  • Selecting the wrong range. A selection can be easy to misread when rows or columns are hidden or the sheet is zoomed out. Check the range in the Name Box before changing its settings.

Tips

  • Use visual cues for input cells. A fill color or a short instruction such as “Enter values in the shaded cells” helps people distinguish unlocked fields from protected formulas. Formatting is a guide, not a lock by itself.
  • Keep formulas protected and input cells open. For a form or calculator, unlock only the cells meant for user entry, then protect the sheet. This helps prevent accidental overwriting of formulas while still making the worksheet usable.
  • Choose permissions deliberately. If people need to filter a table, format cells, or insert rows, consider the matching permission in the Protect Sheet dialog. Test the exact action after protection; permissions do not guarantee that every action will work in every layout.
  • Consider workbook structure separately. If you also need to prevent users from changing the sheet tabs, use the workbook-structure protection option separately. It serves a different purpose from locking a cell range.
  • Make a backup before changing protection on an important file. It is easy to overlook a range or permission. A copy gives you a way to recover the original setup if you accidentally lock the wrong cells.

Troubleshooting

I can still type in the cell after checking Locked. Confirm that the correct worksheet is protected: return to Review and look for Unprotect Sheet, which indicates that protection is active. If the sheet is not protected, select Protect Sheet. If it is protected but the cell remains editable, unprotect the sheet and inspect the cell’s Protection setting with Ctrl+1. The cell may have been unlocked, or it may be part of a mixed selection that was not set as intended.

Every cell is blocked, including the input fields. Unprotect the worksheet, select the cells intended for input, press Ctrl+1, and clear Locked on the Protection tab. Select OK, then protect the sheet again. Test an input cell and a protected cell separately. On Mac, use Command+1 for Format Cells; the protection concepts are the same.

The Protect Sheet command is unavailable or I cannot change settings. Check whether the workbook is in a restricted or read-only state, and whether the current sheet is already protected. If it is protected, choose Review > Unprotect Sheet and enter the password if prompted. If you do not know the password, ask the workbook owner or your organization’s support team; do not assume Excel can recover it. If you are using Excel for the web and cannot find a needed protection option, open the workbook in the desktop app, where the full Format Cells and protection controls are available.

I cannot sort, filter, or format after protecting the sheet. Unprotect the sheet, reopen Review > Protect Sheet, and allow the specific action users need. Some actions can still be limited by the layout or by protected cells, so test with a sample edit. If the worksheet contains a table or filtered range, confirm the intended filtering behavior before sharing the protected file.

I forgot the password. If you set a password, Excel will request it when you try to unprotect the sheet. Check your password manager, team documentation, or the workbook owner’s records. Without the password, you may need an authorized source copy or help from your organization. For future work, keep a separate unprotected backup in a secure location.

Frequently Asked Questions

What does locking a box in Excel mean?
It marks a cell or range as unavailable for editing when its worksheet is protected. It does not prevent editing until sheet protection is turned on.

Can I lock just one cell and leave the rest editable?
Yes. Unlock the whole sheet first, mark the one cell or range as Locked, then protect the sheet. Only cells left marked Locked will be blocked from editing.

How do I lock a cell without a password?
Set the cell’s Locked property and choose Review > Protect Sheet, leaving the password field blank. The sheet is protected against ordinary edits, but anyone can unprotect it without a password.

Can people still select a locked cell?
Yes, if Select locked cells remains checked in the Protect Sheet dialog. Clear that permission if you want to prevent selection, but users may find it harder to navigate around the protected area.

Does locking a cell encrypt its contents?
No. Worksheet protection is designed to limit edits, not conceal data. Do not use it as the sole safeguard for sensitive information.

Does this work in Excel for Mac or the web?
The same basic idea applies in Excel for Mac: set Locked in Format Cells, then protect the sheet. On Mac, Command+1 opens Format Cells. Excel for the web has protection features, but some settings differ or may be unavailable; use the Windows or Mac desktop app for the steps and detailed permissions above.

Related

Try it: the Date Difference Calculator: days, months, years and weekdays between two dates, with the DATEDIF formulas.

More in How-to basics

Sources: Function behaviour and menu paths: Microsoft Support documentation for Excel. Method & sources

Spotted an error in this guide? Let us know.