Lock an Excel Cell from Being Edited: Step-by-Step

How-to basics · Updated November 20, 2026

To lock one cell in Excel, first unlock the worksheet’s other cells, then mark the target cell as locked and protect the worksheet. Cell locking does not take effect until sheet protection is turned on. These steps are for Excel for Microsoft 365 on Windows; make a copy of an important workbook before changing protection settings.

What You’ll Need

  • An Excel workbook you can edit. If it is read-only or protected already, you may need the owner’s permission or the existing password.
  • A clear idea of which cell or cells should be protected and which cells should remain editable.
  • Optionally, a password for worksheet protection. You can protect a sheet without one, but anyone with access may then be able to remove protection.

Step-by-Step

  1. Save a working copy. Use File > Save As to create a separate copy if the workbook contains important information or existing protection settings. This gives you a way back if you unlock the wrong range or change the sheet’s allowed actions. If someone else owns the workbook, check before changing its protection.
  2. Open the worksheet you want to protect. Click the sheet tab at the bottom of the Excel window. Protection applies to one worksheet at a time, so repeat these steps on each sheet where you need a locked cell. If the tab or worksheet is protected already, note that you may need to choose Review > Unprotect Sheet and enter the current password before changing cell settings.
  3. Select all cells on the worksheet. Click the small triangle at the upper-left corner of the grid, where the row numbers and column letters meet. This selects the whole worksheet, not just the current data region. This is more dependable than pressing Ctrl+A, which can select only a table or a connected block of data depending on where the active cell is.
  4. Unlock the whole selection. On the Home tab, open the Format Cells dialog by pressing Ctrl+1. Select the Protection tab, clear the Locked checkbox, and click OK. The cells are now marked as unlocked, but the worksheet is not yet protected, so this change does not prevent editing by itself. If the Locked box appears filled or shaded for a mixed selection, click it until it is clear.
  5. Select the cell you want to protect. Click the target cell, such as D5, or select a range if several adjacent cells should be locked. To select several separate cells or ranges, hold Ctrl while clicking or dragging each one. Check the Name Box to the left of the formula bar if you want to confirm the selected address before changing its setting.
  6. Mark the target as locked. Press Ctrl+1 again, open the Protection tab, select the Locked checkbox, and click OK. This sets the cell’s locked property. You can also check Hidden if you want to hide a formula from the formula bar when the sheet is protected; that option does not hide the cell’s displayed result.
  7. Turn on worksheet protection. Go to Review > Protect Sheet. In the Protect Sheet dialog, make sure “Protect worksheet and contents of locked cells” is selected. Choose which actions users may still perform, such as selecting unlocked cells or sorting, and enter a password if you want one. Click OK, then re-enter the password if Excel asks you to confirm it. Store the password somewhere safe; Microsoft cannot recover a forgotten worksheet-protection password for you.
  8. Test the result. Click an unlocked cell and confirm that you can type in it, then try to change the locked cell. Excel should prevent editing of the protected cell. If you allowed users to select only unlocked cells, you may not be able to click the locked cell at all; that is expected. Save the workbook after checking that the editable areas and permitted actions behave as intended.

On a Mac: The same principle applies: unlock the cells that should remain editable, lock the target, and protect the sheet. Select the worksheet using the corner button above row 1 and left of column A, then use Format Cells (Command+1 on many Mac keyboards) and its Protection settings. Use the Review tab’s Protect Sheet command to enable protection. Menu labels and dialog layout can vary slightly by Excel for Mac release. Excel for the web has protection features, but for dependable bulk changes to cell locking, use the desktop app if the relevant Protection controls are not available in your browser.

Common Mistakes

  • Locking the cell but not protecting the sheet. Locked is the default property for cells in a new worksheet, but it has no practical effect until you protect the worksheet. If the cell remains editable, check Review > Protect Sheet.
  • Forgetting to unlock the other cells first. If you protect a sheet without changing the default settings, nearly every cell may become uneditable. Select all cells and clear Locked before locking only the target cell.
  • Selecting only part of the worksheet by mistake. Ctrl+A can select a table or a contiguous block rather than every cell. Use the corner button between the row and column headings to select the entire sheet.
  • Changing the wrong range. Before using Format Cells, look at the selection and the Name Box. When changing settings for a group, make sure the group does not include cells that should stay editable.
  • Assuming protection is encryption. Worksheet protection is intended to prevent accidental edits and limit ordinary changes, not to secure confidential data from determined access. Do not rely on it to keep sensitive information secret.
  • Choosing a password that cannot be retrieved. Excel does not provide a normal password-recovery option for a forgotten sheet-protection password. Avoid a password you cannot store and retrieve safely.

Tips

  • Make editable input areas obvious. Use a consistent fill color or a short instruction near unlocked cells so people can tell where to enter information. Formatting is only a visual cue; the Locked setting and sheet protection control editing.
  • Allow only the actions users need. In the Protect Sheet dialog, review the list of permitted actions instead of accepting every option automatically. For a simple form, allowing users to select unlocked cells may be enough. If users need to sort, filter, or format, allow only the relevant actions and test them after protection is on.
  • Keep formulas safe without hiding useful results. Lock formula cells so they cannot be overwritten. If you also select Hidden in Format Cells > Protection, the formula is hidden from the formula bar only while the worksheet is protected; the calculated value can still appear in the cell.
  • Use a clear setup for repeated forms. If you have many input cells, select all cells and unlock them first, then select the formula and heading ranges that should be protected. Lock those ranges together before protecting the sheet. Check a few cells from each range rather than assuming every selection worked.
  • Remember that protection is per sheet. Protecting one worksheet does not automatically protect other sheet tabs, nor does it prevent someone from changing the workbook’s structure. Set up each sheet and any workbook-structure protection separately if needed.
  • Keep a clean, unprotected source copy. For templates that will be reused, retain a master copy with the intended cell settings documented. This makes it easier to revise the form later without guessing which cells were meant to be editable.

Troubleshooting

I can still edit the supposedly locked cell. Confirm that the correct worksheet is protected: open Review and look for Unprotect Sheet rather than Protect Sheet. If it still says Protect Sheet, protection is off. If the sheet is protected, unprotect it if you know the password, select the cell, open Format Cells > Protection, and check that Locked is selected. Protect the sheet again and test the cell. Also confirm that you did not select a different cell when setting the property.

All cells became uneditable. This usually means the sheet was protected before the other cells were unlocked, or the whole sheet was not actually unlocked. Unprotect the worksheet, select the entire sheet with the corner button, clear Locked in Format Cells > Protection, and then lock only the cells that need protection. Turn protection on again. If only certain ranges should be editable, verify those ranges individually before saving.

The Locked checkbox is unavailable or I cannot change it. The worksheet may already be protected. Go to Review > Unprotect Sheet and enter its password, then adjust the cell settings. If you do not know the password, ask the workbook owner or the person who applied protection; do not assume that renaming the file or changing its extension will remove protection safely.

I cannot click the protected cell. This can be intentional. In the Protect Sheet dialog, “Select locked cells” may be cleared, which prevents selecting locked cells. If you need users to select the cell to copy or inspect it while still preventing edits, unprotect the sheet, turn on Select locked cells in the protection options, and protect it again. Test both selection and editing afterward.

Users can edit cells, but a feature they need no longer works. Sheet protection limits actions as well as cell editing. Unprotect the sheet, enable the necessary permission in Protect Sheet—such as sorting or using AutoFilter—and protect it again. Some operations have additional restrictions when protected ranges contain locked cells, so test the actual workflow with a copy of the workbook before distributing it.

I forgot the password. Excel does not offer a standard way to retrieve a lost worksheet-protection password. Contact the person who set it or restore an unprotected backup. For future workbooks, keep passwords in an approved password manager and preserve a controlled source copy. Do not store a sensitive password in a cell on the same worksheet.

Frequently Asked Questions

Are cells locked by default in Excel?
Yes. Cells are generally marked Locked by default, but that setting only blocks changes after you protect the worksheet. To protect one cell while leaving others editable, unlock the other cells first.

Can I lock just one cell without protecting the entire sheet?
No. Excel’s Locked property takes effect through worksheet protection. You can protect the sheet while leaving selected cells unlocked, so users can still edit designated input cells.

Can I protect a formula but let someone edit the inputs?
Yes. Unlock the input cells, leave formula cells locked, and protect the worksheet. Test the workbook to confirm that inputs can be changed and formula cells cannot be overwritten.

Does protecting a worksheet stop people from opening the workbook?
No. Worksheet protection controls editing on that sheet; it is not the same as requiring a password to open an encrypted workbook. Use the appropriate file-level security option if you need to restrict access to the file.

Can I remove the lock later?
Yes, if you can unprotect the sheet. Choose Review > Unprotect Sheet and enter the password if prompted, change the Locked setting in Format Cells > Protection, and protect the sheet again if you still need other restrictions.

Does locking a cell work the same way in Excel for the web?
The underlying idea is the same, but available controls can differ by browser version and workbook setup. If you cannot find the cell Protection setting or need to change many cells, open the workbook in Excel for Microsoft 365 on Windows or Mac.

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.