How to Lock Cells in Excel for the Web and Protect Data

How-to basics · Updated November 18, 2026

To lock cells in Excel for the web, unlock any cells people should still be able to edit, then protect the worksheet: select the input cells, choose Home > Format > Lock Cell to unlock them, and select Review > Manage Protection to turn on Protect sheet. A cell’s Locked setting only prevents edits after sheet protection is enabled. This is useful for protecting formulas and headings in a shared workbook, but it is not a substitute for file permissions or encryption.

What You’ll Need

  • A workbook opened in Excel for the web in a supported browser, with permission to edit it and change its protection settings.
  • A clear idea of which cells should be protected and which cells other people need to edit. For example, you might protect formula cells in a budget while leaving the monthly expense input cells editable.
  • Optional: a separate copy of the workbook if you are changing protection on an important shared file. Sheet protection can affect how collaborators work in the same sheet.

These steps are for Excel for the web, sometimes called Excel online. If you are using the Windows desktop app, the equivalent protection controls are on the Review tab, and cell locking is available through Home > Format > Format Cells > Protection. On a Mac, use the same general worksheet-protection approach in Excel for Mac; ribbon labels and the placement of commands can differ slightly by version. The browser instructions below use the current web ribbon labels.

Step-by-Step

  1. Open the correct workbook and worksheet. Sign in to Microsoft 365, open the workbook in Excel for the web, and select the sheet you want to protect. If the file opens in a read-only view, ask the owner for editing access before proceeding. Protection changes are made sheet by sheet, so protecting one tab does not automatically protect every other tab in the workbook.
  2. Decide which cells should remain editable. Identify the cells where colleagues will enter information, such as order quantities, dates, or comments. Also identify formulas, labels, and other content that should not be changed. If there are several editable areas, note each range before changing settings. For example, a simple form might allow edits in B4:B12 and D4:D12 while keeping the labels in column A and calculated totals protected.
  3. Unlock the cells people are allowed to edit. Select the first input range. On the Home tab, open Format and choose Lock Cell to change the selected cells to unlocked. Repeat for each input range. The command is a toggle, so pay attention to the selection and its current state: clicking it on an already-unlocked range can lock that range instead. If the command is not visible in your version of Excel for the web, open the workbook in the desktop app and use Home > Format > Format Cells > Protection, then clear the Locked check box for the selected input cells.
  4. Check whether the rest of the sheet is set to lock. In a new worksheet, cells are usually marked as locked by default, even though nobody is prevented from editing them until sheet protection is turned on. That default is convenient when you want most of a sheet protected and only a few input cells available. If you instead want to protect just a few cells and leave the rest editable, select the whole worksheet, use Home > Format > Lock Cell to unlock it, then select the cells to protect and use the same command to lock them. Confirm the selection carefully before applying a toggle to a large range.
  5. Turn on worksheet protection. Select Review > Manage Protection. In the protection pane, turn on Protect sheet. If the pane offers a password field, you can set a password before saving the protection settings. Choose a password you can retain securely; anyone who needs to remove protection may need it. If the pane presents permissions for actions such as selecting locked or unlocked cells, choose the options that fit the task. For a fill-in form, allowing users to select unlocked cells is often helpful.
  6. Save or confirm the protection settings. Follow the prompt in the Manage Protection pane to apply the settings. Excel for the web usually saves changes to a cloud-hosted workbook automatically, but wait for the save indicator to finish before closing the tab. If the file is stored in OneDrive or SharePoint, make sure you are working in the intended shared copy rather than a downloaded duplicate.
  7. Test the sheet as a user would. Try entering text in one of the unlocked input cells, then try changing a protected formula or heading. The input should accept the change; the protected cell should be blocked while sheet protection is active. If both areas behave the same way, revisit the Locked setting and protection status rather than assuming the workbook saved correctly.
  8. Tell collaborators what they can edit. After testing, explain which cells are intended for entry and whether the sheet is protected with a password. Protection can prevent accidental edits, but it does not control who can open the workbook. Use the file’s OneDrive or SharePoint sharing permissions to manage access to the workbook itself.

To protect every cell on a sheet, you can usually skip the unlocking step and turn on Protect sheet. Because cells are commonly locked by default, protection will then prevent edits across the sheet. Before doing that, check whether collaborators need to enter data anywhere; otherwise, they may be unable to complete the workbook.

Common Mistakes

Locking cells but not protecting the sheet: This is the most common source of confusion. The Locked property is only a setting until you enable worksheet protection. If users can still edit a cell you marked as locked, check Review > Manage Protection and make sure Protect sheet is on.

Protecting the sheet before unlocking input cells: When protection is enabled, users may find that even the form fields are unavailable. Turn protection off, unlock the intended input ranges, and then protect the sheet again. Do not simply unlock cells after protection and expect the change to work without updating or reapplying the protection settings.

Assuming a locked cell is secure: Worksheet protection is designed mainly to prevent accidental changes. It does not encrypt the workbook, hide its contents from people who can access the file, or replace OneDrive and SharePoint access controls. Do not use it to store sensitive information that collaborators should not see.

Applying the toggle to the wrong selection: Lock Cell acts on the cells currently selected. If you select a whole row, column, or sheet by mistake, you may change far more cells than intended. Check the highlighted selection before using the command, especially when working with non-adjacent ranges or a large worksheet.

Confusing workbook and worksheet protection: Protecting a sheet controls cell editing on that sheet. It is different from restricting who can open or share the workbook, and it is different from protecting the workbook structure. If the goal is to stop someone from adding, deleting, or renaming tabs, look for workbook-structure protection rather than relying on cell locking.

Tips

Use a simple visual cue to show which cells accept input. A light fill color or a short instruction such as “Enter values in blue cells” can make a protected template easier to use. Do not rely on color alone if accessibility matters; include a text note or clear labels as well.

Keep formulas separate from manual inputs where possible. For example, put entered quantities in one column and calculated totals in another. Unlock only the input range, then protect the sheet so a user can change quantities without overwriting calculations. Test any formulas and data-entry controls after protection is enabled.

Before changing a sheet that several people use, consider making a copy or coordinating the change. Protection settings affect everyone using that worksheet, and collaborators may have the workbook open at the same time. Once protection is on, check that the expected cells remain selectable and that routine tasks, such as filtering or sorting, still work if users need those actions.

Use a password only if it helps with your workflow, and store it somewhere appropriate for the people responsible for maintaining the workbook. A forgotten password can make later changes difficult. If you do not need to restrict users from turning protection off, a password may not be necessary for a sheet intended mainly to prevent accidental edits.

For a reusable template, protect a test copy first. Enter sample values, check calculations, and try the actions collaborators will need. This small review can catch locked input cells, editable formulas, or an overly restrictive set of permissions before the template is shared widely.

Troubleshooting

I cannot find Manage Protection. Confirm that the workbook is open in Excel for the web and that the Review tab is available. Ribbon commands can be hidden when the browser window is narrow; expand the window or inspect the tab’s overflow menu. If the control is still unavailable, check whether you have edit permission or open the workbook in the desktop Excel app and use Review > Protect Sheet.

Users can still edit a cell that should be locked. Verify that the cell’s Locked setting is on, then confirm that Protect sheet is enabled for that worksheet. If the cell belongs to a range you unlocked earlier, select it and change its setting before protecting the sheet again. Test with a different cell too, since a range selection may not have included every cell you expected.

Users cannot type in the cells meant for input. Turn off sheet protection, select the input range, and use Home > Format > Lock Cell to unlock it. Re-enable protection and test again. If you changed the settings in the desktop app, save the workbook and reopen it in the browser to confirm that the changes have synced.

The protection command is disabled or changes will not save. The workbook may be read-only, opened in a mode that does not support editing, or affected by an organization’s sharing policy. Confirm that you can edit an ordinary cell in an unprotected sheet, check the file’s permissions, and ask the owner or administrator if needed. If the workbook is stored in a shared location, wait for sync to finish and check for a conflicting copy.

I forgot the protection password. Check your organization’s password manager or ask the person who set up the workbook. Do not assume that file-sharing access will remove sheet protection; those are separate controls. If you cannot recover the password, contact your organization’s Microsoft 365 administrator or rebuild the sheet from an authorized copy, following your organization’s policies.

Frequently Asked Questions

Can I lock only certain cells in Excel for the web?
Yes. Unlock the cells that users need to edit, leave the cells you want protected locked, and then turn on Protect sheet. If you need only a few protected cells, unlock the rest of the sheet first and then lock those specific cells.

Do I need to protect the worksheet after marking cells as locked?
Yes. The Locked setting alone does not stop editing. Turn on worksheet protection through Review > Manage Protection for the setting to take effect.

Can other people still view locked cells?
Yes. Sheet protection restricts editing actions; it does not hide cell contents. Manage who can view the workbook through its OneDrive or SharePoint sharing permissions.

Can I lock cells without a password?
Yes, if the protection pane allows you to enable sheet protection without setting a password. A password can make it harder for someone to turn protection off, but it is not a replacement for secure file access.

Does locking cells work in the Excel mobile app?
Protection and editing controls can vary by app and version. Set up and verify the cell and sheet protection in Excel for the web or the desktop app, then check the workbook on the mobile device your collaborators use.

Will locking cells stop people from deleting the workbook?
No. Cell locking applies to edits within a protected worksheet. Use file permissions and appropriate storage controls to manage who can delete, move, or share the workbook.

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.