How to Lock Cells in Excel So No One Can Edit Them

How-to basics · Updated November 18, 2026

To stop people changing particular cells in Excel, first unlock the cells they should still be able to edit, then select the cells to restrict and turn on worksheet protection with Review > Protect Sheet. Excel marks cells as locked by default, but that setting takes effect only after you protect the worksheet. This is useful for safeguarding formulas and fixed headings while leaving input cells open; it is not a substitute for encryption or secure access controls.

What You’ll Need

  • An Excel workbook opened in the desktop version of Microsoft Excel for Microsoft 365 on Windows. The steps below use its ribbon and Format Cells dialog.
  • Permission to change the worksheet’s protection settings. If it is already protected, you may need its password to unprotect it first.
  • A clear idea of which cells people should be allowed to edit. Make a copy of the workbook before changing protection if the sheet is important or shared.

Step-by-Step

  1. Open the worksheet and check whether it is already protected. Select the sheet tab you want to protect. On the Review tab, look for Unprotect Sheet. If that command appears, the sheet is protected already; choose it and enter the password if Excel asks. You must remove existing protection before changing which cells are locked. If you do not know the password, ask the workbook owner or administrator rather than assuming you can edit the protection settings.
  2. Decide whether all cells or only some cells should be editable. If nobody should change any cell, you can skip to the protection step: all cells are marked Locked by default. If users need to enter information in certain places, identify those input cells first. For example, a quote worksheet might keep formulas and labels locked while allowing entries in B4:B8. The distinction matters because selecting Protect Sheet without unlocking the intended input cells will make those cells unavailable too.
  3. Unlock the cells users are allowed to change. Select the input range. To select more than one separate range, hold Ctrl while selecting each range. Press Ctrl+1 to open Format Cells, choose the Protection tab, clear the Locked checkbox, and select OK. The Locked setting is sometimes shown as a filled or indeterminate checkbox when the selection mixes locked and unlocked cells; select a consistent range and set the checkbox deliberately. On Excel for Mac, use Command+1 to open Format Cells, then use the Protection tab in the same way.
  4. Confirm that the cells to restrict are locked. If you are keeping Excel’s default for the rest of the sheet, you can leave these cells alone: they are already marked Locked. To check a cell or range, select it, press Ctrl+1, and look on the Protection tab. The Locked box should be selected. If you previously unlocked the whole sheet or a wider range, select the cells you now want to protect and select Locked before choosing OK. Do not turn on protection yet if you still need to adjust the ranges.
  5. Protect the worksheet. Go to Review > Protect Sheet. In the dialog, leave Protect worksheet and contents of locked cells selected. Enter a password if you want to make it harder for someone to turn protection off, then enter it again when prompted. A password is optional: leaving it blank still applies sheet protection, but anyone with access can remove that protection without entering a password. Keep a password somewhere safe because Excel may not be able to recover it for you.
  6. Choose what people may do on the protected sheet. In the Protect Sheet dialog, review the list of permitted actions. Select Select unlocked cells so users can move to and enter data in the ranges you opened. Select Select locked cells only if you want users to be able to click or copy from protected cells; it does not make their contents editable. Other permissions, such as sorting, filtering, or formatting, are optional and depend on how the sheet is built. Allow only the actions users actually need, then select OK.
  7. Test the result as a user would. Try typing in a cell that should be locked; Excel should display a warning and refuse the edit. Then enter a temporary value in an unlocked input cell to make sure it is available. If the input cell is blocked, unprotect the sheet, revisit its Locked setting, and protect the sheet again. Remove any test value afterward and save the workbook.

To protect every cell, omit the step that unlocks input cells and protect the sheet directly. To protect a formula area while keeping the rest of the sheet usable, unlock the cells users need first, then protect the worksheet. Worksheet protection applies to the entire sheet, but the Locked setting determines which cells are restricted.

Common Mistakes

Locking cells but not protecting the sheet. This is the most common reason cells that appear locked remain editable. The Locked checkbox is only a cell setting; it has no effect until worksheet protection is on. After setting it, use Review > Protect Sheet and test an edit.

Forgetting to unlock input cells. New Excel cells are locked by default. If you protect the worksheet without changing the input ranges, users may be unable to fill in a form or update a template. Decide which cells are inputs and clear their Locked setting before protection.

Unlocking the wrong range. It is easy to select a neighboring column, an entire row, or only part of a merged area. Check the Name Box to confirm the selected address before changing the Protection setting. Afterward, test both an intended input cell and a formula cell.

Expecting sheet protection to secure confidential information. Worksheet protection is designed to prevent ordinary edits to cells and parts of a sheet. It does not encrypt the workbook or make its data inaccessible to someone who can open the file. Use file-level encryption and appropriate sharing permissions for confidential information.

Allowing actions that change the layout. The Protect Sheet dialog can permit actions such as formatting, inserting rows, or sorting. These permissions may be helpful, but they can also affect the layout or make a carefully designed worksheet harder to maintain. Consider what users need before enabling them.

Tips

Use fill color, borders, or a short instruction near the input area to show which cells users can edit. Visual cues do not enforce protection, but they help people understand how to use the sheet. A note such as Enter information in the shaded cells is often clearer than expecting people to discover the editable ranges themselves.

Keep formulas and user input separate where practical. For instance, put inputs in a clearly labeled block and calculations in another area. This makes it easier to unlock only the cells that need editing and reduces the chance of accidentally leaving a formula cell open. If your workbook has several worksheets, protect and test each one separately; protecting one sheet does not automatically protect the others.

If a sheet needs filters, check the Protect Sheet permissions and test filtering after protection is enabled. Similarly, test sorting or data entry controls that users rely on. Some actions behave differently depending on the worksheet layout, existing filters, and Excel version, so a quick check with the actual workbook is more dependable than assuming a permission will behave as intended.

Worksheet protection is not the same as protecting the workbook structure. Protect Sheet restricts changes to cells and permitted worksheet actions. Protect Workbook can restrict changes such as adding, deleting, or moving sheets. Use the option that matches the change you want to prevent, and remember that neither option is a replacement for controlling who can access the file.

If several people collaborate on a workbook, explain what is locked and who can change the protection settings. In shared or coauthored files, available controls and behavior can depend on how the file is stored and which Excel app each person uses. The desktop Windows steps here are the clearest way to set the cell-level options. Excel for Mac has similar worksheet protection controls, though ribbon placement and dialog presentation can vary slightly. Excel for the web may not expose every desktop protection setting, so use the desktop app to configure the sheet if a control is missing.

Troubleshooting

I can still edit a cell that should be locked. Check that the worksheet is protected, not merely that the cell’s Locked box is selected. Select the cell, open Format Cells with Ctrl+1, and confirm Locked is checked. Then check Review for Unprotect Sheet, which indicates protection is active. If you can edit the cell, protection may have been turned off, the cell may be unlocked, or you may be editing a different sheet than the one you protected.

A user cannot type into an input cell. Unprotect the sheet, select the cell, and inspect Format Cells > Protection. Clear Locked, select OK, and protect the sheet again. Also confirm that the user is selecting the intended range and that the sheet is not protected with settings that prevent selecting unlocked cells. If the input area uses merged cells, test the merged area as a whole.

Excel asks for a password I do not have. You cannot change protection settings while the sheet remains protected. Contact the file owner or whoever set the password and ask them to unprotect the worksheet or provide an authorized editable copy. Avoid relying on a password you cannot retrieve; keep passwords in an approved password manager or other secure location.

The Protect Sheet command is unavailable or looks different. Confirm that you are in the desktop Excel app and that the correct workbook and worksheet are active. A workbook opened in a browser, a file with restricted permissions, or a different Excel interface may show a different set of controls. Open the file in Excel for Microsoft 365 on Windows and check Review again. On Mac, look on the Review tab for the sheet protection controls.

Users can change a value but can also change more than expected. Unprotect the sheet and review the permissions selected in the Protect Sheet dialog. Remove permissions that are not needed, then protect the sheet and retest. If the file is shared, remember that someone with permission to edit the workbook may still be able to copy content or create another copy; cell protection is about limiting worksheet edits, not controlling every use of the data.

Frequently Asked Questions

Are cells locked by default in Excel?
Yes. Cells are generally marked Locked by default, but that setting does not stop edits until you turn on Protect Sheet. You can clear Locked for specific input cells before protecting the worksheet.

Can I lock only certain cells and leave others editable?
Yes. Unlock the cells people need to change, leave the other cells marked Locked, and then protect the sheet. Excel applies the protection to the worksheet while respecting each cell’s Locked setting.

Can I protect cells without a password?
Yes. You can protect a sheet without entering a password. That prevents normal edits to locked cells while protection is on, but a person with access can turn protection off without a password. A password adds a barrier to changing the protection settings; it is not file encryption.

Does locking cells prevent someone from viewing or copying their contents?
No. Sheet protection primarily restricts editing. A user may still be able to view or copy data, depending on the permissions and how the workbook is shared. Do not use it to hide sensitive information.

How do I let people use filters on a protected sheet?
When you protect the sheet, review the permitted actions and allow Use AutoFilter if that option is available and the worksheet already has filters set up. Then test the filter controls while the sheet is protected. If the expected option is unavailable, check the workbook in desktop Excel and review how the filter was created.

Can I lock cells in Excel for the web?
Some worksheet protection tasks are available in Excel for the web, but its controls may differ from desktop Excel and may not include every setting. For precise control over which ranges are locked and which actions are allowed, open the workbook in the desktop app and follow the steps 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.