To lock cells in Excel for the web, leave the cells you want protected marked as locked, unlock any cells people should be able to edit, and then protect the worksheet from the Review tab. Cell locking does not take effect until sheet protection is on. This is useful for keeping formulas, headings, or reference values from being changed accidentally while leaving designated input cells available.
Before you begin, make sure you have edit access to the workbook. If the sheet is already protected, you may need its password to change cell settings. Worksheet protection helps prevent edits; it is not a security measure for confidential data, so do not use it as a substitute for access controls or encryption.
What You’ll Need
- The workbook open in Excel for the web, with permission to edit it.
- A clear idea of which cells should be protected and which ones should remain editable. For example, you might protect formula cells in a budget sheet but leave the quantity and price entry cells open.
- The sheet-protection password, if the worksheet is already protected and you need to change its settings. If you do not know the password, ask the workbook owner.
Step-by-Step
- Open the correct worksheet and check its protection status. Open the workbook in Excel for the web and select the sheet tab you want to configure. Go to Review and look for Protect Sheet or the sheet-protection controls. If the sheet is already protected, turn protection off before changing which cells are locked; Excel may ask for a password. Do not remove protection from a shared sheet without checking with its owner or collaborators, because they may rely on its current setup.
- Decide what people should be able to change. Make a simple plan before changing cell settings. For instance, on an order form, you could leave customer name and quantity fields editable while protecting labels, totals, and formulas. Remember that Excel cells are normally marked as locked by default, but that setting does not prevent edits until you protect the sheet. If the sheet has never been specially configured, it is usually easier to unlock the intended input cells than to lock every formula cell one by one.
- Select the cells that should stay editable. Drag across a range, click a cell and extend the selection with Shift-click, or use the Name Box to go directly to a range such as B3:B15. For separate ranges, select one range at a time and change its lock setting. Take care not to include formula cells in an input range. You can click a cell and inspect the formula bar: a formula typically begins with an equals sign, whereas an entry field may contain a value or be blank.
- Unlock those input cells. With the editable range selected, go to Home > Format > Lock Cell and turn off the lock setting for that selection. The command may appear as a toggle, so check its current state rather than assuming that clicking it always unlocks cells. If Excel shows a check mark or other selected state, turn that state off for the input range. Repeat for each area that users should be able to edit. If the Lock Cell command is unavailable in your version or workbook, use the desktop-app alternative described in Troubleshooting.
- Leave the cells you want protected locked. Formula and heading cells can remain at their default locked setting. If someone previously unlocked a range that should now be protected, select that range and use Home > Format > Lock Cell to turn its lock setting on. When you are configuring a sheet with many mixed settings, work in small, identifiable ranges and verify each selection; changing a mixed selection can be confusing because some cells may be locked while others are not.
- Protect the worksheet. Go to Review > Protect Sheet and follow the protection controls shown in Excel for the web. If prompted, choose the actions that users are allowed to perform, such as selecting cells. The available options can vary with the workbook and Excel interface. Add a password only if you need one, and store it somewhere secure that the sheet owner can access. Confirm the protection setting. With sheet protection enabled, locked cells should reject edits, while unlocked cells remain available for entry.
- Test both kinds of cells. Try typing in one of the cells you meant to protect, then try typing in an unlocked input cell. Excel should prevent the first edit and allow the second. If the wrong cells are editable, remove sheet protection, correct the lock settings, and protect the sheet again. Testing before sharing catches range-selection mistakes and helps confirm that the form works as intended.
- Save and tell collaborators what to expect. Excel for the web generally saves changes to a cloud workbook automatically, but check that the save indicator shows the latest changes have been saved before closing the file. Let collaborators know which cells they can fill in and whom to contact if a protected formula or label needs a legitimate change. If they cannot edit even the input fields, check their workbook permissions as well as the cell settings.
Common Mistakes
Protecting the sheet without unlocking input cells. Because cells are generally locked by default, turning on protection without first unlocking the entry areas can make the whole sheet seem read-only. Turn protection off, unlock the intended fields, and then protect the sheet again.
Locking cells but not protecting the worksheet. A cell’s locked setting is only a preparation step. Without sheet protection, users can still edit the cell normally. Always test after switching protection on.
Selecting the wrong range. A selection can accidentally include a total, formula, or heading. Use the Name Box for a clearly defined range and double-check the highlighted cells before changing their lock setting. For nonadjacent areas, repeat the operation carefully for each range rather than assuming the selection includes only the intended fields.
Assuming protection encrypts or hides information. Sheet protection is designed to control ordinary editing, not to keep determined users from viewing or extracting workbook contents. Do not put sensitive information in a workbook merely because a sheet is protected.
Forgetting the password or blocking normal tasks. A password can make future changes difficult if it is lost. Also, protection options may prevent useful actions such as sorting or selecting certain cells. Decide what collaborators need to do before enabling protection, and test those tasks.
Tips
Use a consistent visual cue for editable fields, such as a light fill color and a short instruction near the top of the sheet. Color alone should not be the only clue; a label such as Enter values in the shaded cells also helps users understand the layout. Avoid coloring every cell, since that makes input areas less obvious.
Keep formulas and inputs logically separated where possible. For example, place user-entered quantities in one group of columns and calculated totals in another. A tidy layout is easier to select correctly, maintain, and explain to collaborators. If formulas are spread throughout an input area, make a list of the ranges to unlock before you configure protection.
Use the least restrictive protection options that still prevent accidental changes. If users need to select unlocked cells, ensure that action is allowed in the protection controls. If they need to sort, filter, or perform another task, check whether the interface offers that permission and test it with a representative collaborator. Permissions can affect how usable a protected sheet feels.
Keep a separate, unprotected working copy if the workbook is a template that will need frequent structural edits. For collaborative files, agree on who owns the password and how authorized changes will be requested. This avoids people making duplicate copies just to fill in a form or asking the owner to repeatedly unlock the sheet.
Troubleshooting
The Lock Cell command is missing or unavailable: Confirm that you have selected cells on a worksheet and that the sheet is not currently protected. Excel for the web’s controls can vary by account, workbook, and interface rollout. If you cannot change the cell lock setting in the browser, choose Open in Desktop App. In desktop Excel for Microsoft 365 on Windows, select the cells, press Ctrl+1, open the Protection tab, and clear Locked for cells that should be editable. On Mac, use Command+1 to open Format Cells. Then save the workbook and return to the web app to protect and test the sheet.
Every cell is read-only after protection: The editable cells may still be marked as locked. Turn off sheet protection, select the intended input range, disable its Lock Cell setting, and enable protection again. If you cannot turn protection off, you need the password or help from the workbook owner.
A protected cell can still be edited: Check that the correct worksheet is protected, not just another tab, and confirm that the cell was not accidentally unlocked. Turn protection off, select the problem cell, set it to locked, then protect the correct sheet and test again. Also check that you are not editing a different copy of the workbook.
You cannot change the protection settings: You might have view-only access, or the sheet may be protected with a password. Ask the owner for edit permission and, if needed, the password. Workbook sharing permission and worksheet protection are separate: edit access to the file does not automatically grant permission to alter a protected sheet.
Changes do not appear for a collaborator: Check the save status and make sure both people have opened the same cloud workbook rather than downloaded or duplicate copies. Refreshing the browser can help show the latest saved state. If edits are still blocked in unlocked cells, verify the collaborator’s file permission and test the exact input range while signed in with an account that has edit access.
Frequently Asked Questions
Can I lock only some cells in Excel for the web?
Yes, when the Lock Cell control is available. Leave the target cells locked, unlock the ranges people should edit, and then protect the worksheet. If the web app does not offer the required lock-setting controls, configure the cell settings in desktop Excel and then protect and test the sheet.
Why do locked cells remain editable before I protect the sheet?
The Locked setting marks how a cell should behave when sheet protection is active; by itself, it does not stop editing. Protect the worksheet after setting the lock status for the cells.
Can people still edit unlocked cells on a protected sheet?
Yes. That is the usual setup for a form or template: protected cells cannot be changed through ordinary editing, and unlocked cells remain available. Workbook permissions still apply, and you should test the setup before sharing.
Can I protect a worksheet without a password?
Excel may let you enable sheet protection without setting a password. That can discourage accidental changes, but anyone with appropriate access may be able to remove or alter the protection. A password adds friction, not strong data security, and should be recorded safely if used.
Does locking cells protect formulas from being viewed?
No. Locking is intended to limit editing, not conceal formula contents or secure the workbook. Do not rely on worksheet protection to hide confidential data. Use suitable file access controls for information that must be restricted.
Can I lock cells in a shared workbook?
Usually, if you have permission to edit the workbook and change its sheet settings. Other collaborators may still have different file permissions, and protected-sheet settings apply to the worksheet rather than granting or removing access to the whole file. Coordinate protection changes with the workbook owner.
Related
- Excel Columns: How Many Are There in a Full Worksheet?
- AGGREGATE Excel: How to Sum While Ignoring Errors
- Aggregate Excel Rows by Category, Product, or Date
Try it: the Date Difference Calculator: days, months, years and weekdays between two dates, with the DATEDIF formulas.
More in How-to basics
- Excel Time Format Over 24 Hours: Display Elapsed Time CorrectlyTo display a duration longer than 24 hours in Excel, select the cells, open Format Cells, choose Custom,…
- How to Remove Data Validation Rules in Google SheetsTo remove data validation in Google Sheets, select the affected cells, open Data > Data validation, then remove…
- COUNT in Excel: Count Numbers in a RangeTo count numeric cells in an Excel range, use =COUNT(A2:A20) when your values are in A2:A20. COUNT includes…
- How to Create Rules in Outlook 365 to Organize EmailTo create a rule in Outlook 365, open Settings > Mail > Rules in new Outlook or Outlook…
- Can You Merge Cells in OneNote? Steps and LimitsYes. In the OneNote desktop app for Windows, you can merge adjacent cells in a table: select the…
- Excel Environmental Data Analysis: Methods and ExamplesExcel can organize environmental measurements, check data quality, calculate summaries, and chart changes over time or between sites.…
Sources: Function behaviour and menu paths: Microsoft Support documentation for Excel. Method & sources
Spotted an error in this guide? Let us know.