To lock an Excel sheet, first unlock any cells people should be able to edit, then select Review > Protect Sheet and choose the actions to allow. You can add a password to prevent others from turning protection off, but worksheet protection is meant to prevent accidental changes—not to secure confidential information. The steps below are for Excel for Microsoft 365 on Windows.
What You’ll Need
- An Excel workbook with the sheet you want to protect.
- A clear idea of which cells should remain editable, such as input fields, and which should be protected, such as formulas.
- Optionally, a password you can store safely. You need it to remove protection later, and Excel cannot reliably recover a forgotten sheet-protection password.
Step-by-Step
- Decide what people should be able to change. Review the sheet before protecting it. Identify data-entry cells, such as blank cells for quantities or comments, and the cells that should stay unchanged, such as formulas, headings, and lookup tables. If the whole sheet should be read-only, you can skip unlocking cells. Make a backup copy before changing protection, especially if the workbook is important or shared.
- Select the cells that should remain editable. Click and drag to select a continuous range. To select separate ranges, hold Ctrl while selecting each range on Windows. If a whole column or row is intended for data entry, click its column letter or row number, but avoid unlocking more than users need. In a sheet with formulas beside input cells, select only the input cells so formulas are not accidentally exposed to edits.
- Unlock the selected cells. On the Home tab, choose Format > Format Cells. In the Format Cells dialog, open the Protection tab, clear the Locked check box, and select OK. The Locked setting is normally enabled by default for cells, but it has no effect until you protect the sheet. You can also use Home > Format > Lock Cell to toggle the setting; check the menu state and selection carefully so you do not lock the cells you meant to make editable. On Windows, Ctrl+1 opens Format Cells. On Mac, use Command+1.
- Protect the worksheet. Select Review > Protect Sheet. In the Protect Sheet dialog, leave Protect worksheet and contents of locked cells selected. Enter a password if you want one, then enter it again when Excel asks you to confirm. Passwords are case-sensitive. If you leave the password blank, users can turn off protection without entering one, so the sheet is only protected against casual or accidental edits.
- Choose permitted actions. In the same dialog, select the actions users should still be able to perform, such as selecting locked cells, selecting unlocked cells, sorting, or using AutoFilter. Keep only the permissions the workflow requires. For example, if users should fill in unlocked cells but not navigate through formula cells, allow selection of unlocked cells and clear selection of locked cells. Some actions, including sorting or filtering, may also depend on how the range or table is set up; test them after protection is enabled.
- Confirm protection and test the sheet. Select OK to apply protection. If you set a password, confirm it when prompted. Try entering a value in an unlocked input cell; it should accept the change. Then try changing a locked formula or heading; Excel should block the edit. Also test any permitted sorting, filtering, or selection behavior. If the result is not right, choose Review > Unprotect Sheet, enter the password if requested, adjust the cell locks or permissions, and protect the sheet again.
- Save and share the workbook appropriately. Save the workbook after testing. Tell collaborators which cells are intended for input and, if they may need to edit the sheet’s structure, share the password through an appropriate separate channel. Sheet protection does not encrypt the workbook or hide information from someone who can access the file. For confidential data, use file-level encryption and suitable access controls instead.
These steps protect one worksheet. Repeat them on each sheet that needs protection. To prevent users from adding, deleting, moving, or renaming sheets, use Review > Protect Workbook and protect the workbook structure separately. Protecting the workbook structure does not replace protecting individual cells on a sheet.
Common Mistakes
- Protecting before unlocking input cells. Since cells are generally marked Locked by default, protecting the sheet first can leave every cell uneditable. Unprotect it, unlock the intended input cells, and protect it again.
- Assuming Locked works by itself. The cell’s Locked property is only enforced after worksheet protection is turned on. A cell may show as locked in Format Cells while remaining editable on an unprotected sheet.
- Unlocking whole ranges for convenience. If the selection includes formulas or labels, users can change them once the sheet is protected. Check the selection before clearing Locked, and test several cells in each editable range.
- Treating sheet protection as a security barrier. It helps control edits in normal Excel use, but it is not encryption and should not be used to protect sensitive information. Use password-to-open encryption or approved file permissions for confidential work.
- Using a password nobody can retrieve. A forgotten sheet password can prevent ordinary unprotection. Store it in an approved password manager or another secure, accessible location before distributing the workbook.
- Expecting every command to work when protected. Protection permissions limit actions, and some operations may need a different setup. For example, filtering may need to be enabled before protection, and sorting can be restricted when the sort range includes locked cells.
Tips
- Make input cells obvious. Apply a fill color, border, or short instruction such as Enter quantity here. Formatting does not enforce editability, but it helps users distinguish input cells from calculated results.
- Label the protected areas. Add a note near the top of the sheet explaining which cells are editable. This can reduce accidental requests to change formulas and make the intended workflow clearer.
- Use the narrowest practical permissions. Allow users to select unlocked cells and only the other actions they genuinely need. Fewer permissions make it easier to preserve the sheet’s layout and calculations.
- Keep an unprotected master copy. Retain a controlled version for maintenance. You can then update formulas or layout changes in the master and apply the same protection process to the version you distribute.
- Consider hiding formulas separately. If you want formulas not to appear in the formula bar, select those cells, open Format Cells > Protection, and select Hidden before protecting the sheet. Hidden formulas are concealed through normal worksheet use only; this is not a way to keep them secret from someone with access to the workbook.
- Remember the Mac and web differences. Excel for Mac also has Protect Sheet on the Review tab, though dialog details and shortcuts can vary. In Excel for the web, look on Review for Manage Protection or Protect Sheet; available controls can differ by account and release. If you need precise cell permissions or formula-hiding options, use Excel desktop and verify the result there.
Troubleshooting
I can’t edit a cell after protecting the sheet. The cell is probably still marked Locked. Choose Review > Unprotect Sheet, provide the password if prompted, select the cell, and clear Locked in Home > Format > Format Cells > Protection. Protect the sheet again and test that cell.
I can still edit cells that should be locked. Check that worksheet protection is on: the Review tab should offer Unprotect Sheet rather than Protect Sheet. If protection is on, select the cell and inspect its Locked setting after unprotecting. Also check whether you are editing a different sheet or a separate unlocked range than intended.
Excel rejects the password. Check capitalization, keyboard layout, and whether Caps Lock or a different language setting changed what you typed. Passwords are case-sensitive. If the password is genuinely lost, look for a legitimate backup or ask the workbook owner; Excel does not provide a standard password-recovery option for sheet protection.
Filtering or sorting is unavailable. Unprotect the sheet and review the allowed actions in Review > Protect Sheet. Enable the relevant permission and set up the filter or range before reapplying protection. If sorting still fails, check whether the sort range includes locked cells, since protection can prevent sorting a mixed range.
The protection options are missing in Excel for the web. The web interface can vary, and some protection settings are easier to manage in the desktop app. Open the workbook in Excel for Microsoft 365 on Windows or Mac, set the protection there, save it, and then reopen it in the browser to check that collaborators see the intended behavior.
Frequently Asked Questions
Does protecting a sheet lock every cell?
It prevents changes to cells marked Locked once protection is enabled. Because cells are usually locked by default, that often means all cells are protected unless you first unlock selected ranges.
Can people still type in unlocked cells?
Yes. Unlock the intended cells before protecting the sheet, then leave the Select unlocked cells permission enabled. Users can edit those cells while locked cells remain protected.
Is a protected Excel sheet password secure?
It is useful for discouraging routine edits, but worksheet protection is not file encryption. Do not rely on it to safeguard confidential data; use file encryption and appropriate sharing permissions.
How do I remove sheet protection?
On the protected sheet, choose Review > Unprotect Sheet. Enter the password if Excel requests it. If no password was set, protection can generally be removed without one.
Can I protect a workbook and a sheet at the same time?
Yes. Protect individual sheets to control cell edits, and use Review > Protect Workbook to protect workbook structure, such as adding, deleting, or renaming sheets. These are separate controls.
Will protection stop someone from changing the workbook file?
No. Sheet protection controls edits made through normal worksheet operations; it does not prevent copying the file, accessing its contents, or using other tools. Use appropriate file permissions and encryption when stronger protection is needed.
Related
- Text Split in Excel: Polish Menus and Methods
- Text Split in Excel: How to Separate Data into Columns
- Rate Quotation Format in Excel: A Practical Guide
Try it: the Date Difference Calculator: days, months, years and weekdays between two dates, with the DATEDIF formulas.
More in How-to basics
- Excel Goes Blank and Stops Responding? Fixes to TryIf Excel goes blank and shows Not Responding, wait briefly first, especially if the workbook is large or…
- Power Query Join Tables: A Practical GuideTo join tables in Power Query, use Merge Queries: open the Power Query Editor, choose Home > Merge…
- Merge Cells in Excel: How to Keep All Your DataNo: in Microsoft Excel, merging cells keeps only the value in the upper-left cell and discards the contents…
- Excel Cell Bullet Points: Add and Format Lists in CellsYes. In Excel for Microsoft 365 on Windows, edit a cell and press Alt+0149 on the numeric keypad…
- Excel Row and Column AutoFit: Steps, Limits, and FixesTo auto-adjust Excel row or column size, select the relevant rows or columns, then choose Home > Cells…
- How to Change Short Date Format in Excel for DatesTo change how dates appear in Excel for Microsoft 365 on Windows, select the date cells, then choose…
Sources: Function behaviour and menu paths: Microsoft Support documentation for Excel. Method & sources
Spotted an error in this guide? Let us know.