To lock cells in Excel, first unlock any cells people should be able to edit, then protect the worksheet: select the input cells, open Format Cells with Ctrl+1, clear Locked on the Protection tab, and choose Review > Protect Sheet. Locked status has no effect until you protect the sheet. This setup helps prevent accidental edits to formulas, labels, or other important content while leaving intended input areas available.
What You’ll Need
- A workbook open in Excel for Microsoft 365 on Windows. The instructions also note where the Mac and web versions differ.
- A clear idea of which cells should be editable and which should be protected. If you are unsure, identify input cells, formula cells, headings, and totals before changing settings.
- Optional: a sheet-protection password. A password can deter casual changes, but worksheet protection is not a substitute for encrypting a file or controlling access to sensitive information.
Step-by-Step
- Decide which areas should remain editable. Make a note of the cells where someone will enter information, such as names in
B2:B30or quantities inC2:C30. Formula cells, headings, and calculated totals are usually left locked. Save a copy of the workbook before changing protection, especially if it is shared or contains complicated layouts. If other people need to edit the file at the same time, check your sharing arrangement as well; sheet protection controls changes to cells, not who can open the workbook. - Choose the protection workflow that fits your sheet. In a new or existing sheet, Excel marks cells as locked by default, but that setting is inactive until worksheet protection is turned on. The usual approach is to keep formula and label cells locked, unlock only the input cells, and then protect the sheet. If instead you need to lock just a small number of cells while leaving most of the sheet editable, start by unlocking the entire sheet and then lock the specific cells. Both approaches rely on the same Locked setting and final protection step.
- For the usual setup, select the cells users may edit. Click the first input cell and drag across the range, or click a range and hold
Ctrlwhile selecting additional non-adjacent ranges on Windows. You can also type a range such asB2:B30in the Name Box to the left of the formula bar and press Enter. On a Mac, useCommandinstead ofCtrlto add non-adjacent selections. Check the selection carefully so you do not include formula cells by mistake. - Unlock the selected input cells. With the intended cells selected, press
Ctrl+1on Windows to open the Format Cells dialog. On a Mac, useCommand+1. Choose the Protection tab, clear the Locked checkbox, and select OK. This does not visibly change the cells, and it does not protect the sheet yet; it simply marks the selected cells as editable once protection is applied. Repeat for any other input ranges that should remain open. - If locking only a few cells, unlock everything first. Click the Select All button at the top-left corner of the worksheet, where the row and column headings meet. Open Format Cells with
Ctrl+1on Windows orCommand+1on Mac, go to Protection, clear Locked, and select OK. Then select the specific cells you want to protect, open the same dialog, and check Locked. This reverses the usual setup: most cells will remain editable, and only your chosen cells will be locked after you protect the sheet. If the sheet is very large, use the Select All corner rather than selecting only the visible data range. - Protect the worksheet. On Windows, choose Review > Protect Sheet. In the dialog, make sure Protect worksheet and contents of locked cells is selected. You can enter a password or leave it blank; if you enter one, Excel asks you to confirm it. Choose which actions users are allowed to perform. For a simple input form, it is often useful to leave Select unlocked cells allowed and consider clearing Select locked cells. Select OK to apply protection. The Mac version has a similar command under Review > Protect Sheet, although the dialog layout and available options can vary by Excel version.
- Test both protected and editable cells. Click a cell that should accept input and type a harmless test value; then undo the test or clear the value. Click a locked cell and try to edit it. Excel should prevent the change and display a message that the cell or chart is protected. Also test any actions users need, such as sorting, filtering, or using a dropdown. If something they need is blocked, unprotect the sheet, adjust the allowed actions or cell setup, and protect it again.
In Excel for the web, sheet protection is managed from the Review tab, commonly through Manage Protection. The controls and options are not identical to desktop Excel. If you cannot find a particular setting, open the workbook in the desktop app and configure protection there.
Common Mistakes
Protecting the sheet before unlocking input cells is the most common problem. Because Excel marks cells as locked by default, protecting a sheet without first clearing Locked on the input ranges makes those cells read-only too. Unprotect the sheet, select the intended input cells, clear Locked in Format Cells, and protect the sheet again.
Assuming Locked means protected by itself causes confusion. The Locked checkbox is a cell property, not an active barrier until you use Protect Sheet. Conversely, clearing Locked on a cell does not remove protection from a sheet that is already protected; unprotect the sheet before changing its cell settings.
Selecting the wrong range can leave formulas editable or lock fields that should accept data. Check the selected addresses in the Name Box before changing the Protection setting. For a non-adjacent selection, verify every range rather than assuming the last click replaced or extended the selection as intended.
Treating worksheet protection as strong security is another mistake. It is designed mainly to prevent accidental changes, not to encrypt workbook contents or stop a determined person from accessing data. Use file encryption and appropriate storage or sharing permissions when confidentiality matters.
Forgetting the password can make it difficult to change protection settings later. Keep a needed password in an approved password manager or documented team process. Do not use a password you cannot retrieve, and do not assume Excel can restore a forgotten sheet-protection password.
Tips
Use consistent visual cues to show people where they can type. For example, give input cells a light fill color and add a short note such as Enter values in the shaded cells. Formatting is only a visual guide; confirm the Locked setting separately, since cell color does not determine whether a cell can be edited.
When protecting a form, allow only the actions the user actually needs. If users should enter data but not change the layout, allow selection of unlocked cells and avoid enabling options such as formatting cells, inserting columns, or deleting rows unless the workflow requires them. If you want users to use filters or sort data, test those actions after protection; the required permissions can depend on how the sheet and data range are set up.
Consider using named ranges or a brief setup note for complex sheets. A name such as Input_Quantities can make it easier to select the right area later, although naming a range does not change its protection. If formulas are important, keep a separate unprotected backup for maintenance and test the protected copy from the perspective of someone filling it in.
Protection is applied to an individual worksheet. If the workbook has several sheets, protect each one that needs it. Protecting the workbook structure is a separate feature: it can restrict adding, deleting, moving, or renaming sheets, but it does not replace protecting cells on each worksheet.
Troubleshooting
I can still edit a cell that should be locked. Confirm that the correct worksheet is protected and that the cell’s Locked option is checked. Select the cell, open Format Cells, and inspect the Protection tab; if the sheet is protected, unprotect it first to change the setting. Also check whether the cell is part of a range you deliberately unlocked. Then protect the sheet again and retest.
I cannot type in a cell that should be editable. Unprotect the sheet, select the cell, and check that Locked is cleared. Confirm that you are working on the expected sheet and that the cell is not merged with a neighboring locked cell. Reapply protection and make sure users are permitted to select unlocked cells. If the cell is still unavailable, check whether the workbook is read-only or whether another access restriction is in effect.
The Protect Sheet command is unavailable or protection will not change. Check whether the workbook is opened in a mode that restricts editing, such as read-only or a protected view, and enable editing only if you trust the file. If the workbook is shared or managed by an organization, permissions or collaboration settings may also affect what you can change. Try opening it in the desktop version of Excel and check the Review tab there.
Users can select a cell but cannot sort, filter, or use another feature. Sheet protection blocks actions unless they are permitted in the Protect Sheet options, and some actions have additional requirements. Unprotect the sheet, enable only the needed action, protect it again, and test with the actual data and controls. Do not enable broad editing permissions just to solve one blocked operation.
You cannot remember the password. If you have another authorized, unprotected copy or a backup, use that to restore or rebuild the sheet. Otherwise, contact the workbook owner or your organization’s administrator. Excel does not provide a supported way to retrieve a forgotten sheet-protection password, so keep a recoverable copy before setting one.
Frequently Asked Questions
Are all cells locked by default in Excel?
Yes. Cells are generally marked Locked by default, but the setting has no effect until you protect the worksheet. Unlock the cells intended for entry before turning on protection.
Can I lock formulas but leave data-entry cells editable?
Yes. Leave formula cells locked, clear Locked on the input ranges, and protect the sheet. Test both kinds of cells afterward to confirm the setup.
Does Protect Sheet password-protect or encrypt my workbook?
No. Worksheet protection mainly restricts editing and helps prevent accidental changes. For confidentiality, use workbook encryption and suitable file access controls.
Can I lock only one cell or a few cells?
Yes. Unlock the whole worksheet, select the cells to protect, check Locked for those cells, and then protect the sheet. Be careful to select the entire sheet when clearing Locked if you want all other cells editable.
How do I change the locked cells later?
Choose Review > Unprotect Sheet, enter the password if prompted, adjust the Locked setting in Format Cells, and protect the sheet again with the desired options.
Does this work the same way in Excel for Mac or the web?
The cell-locking concept is the same. On Mac, use Command+1 instead of Ctrl+1 to open Format Cells. Excel for the web uses Review protection controls, but some settings differ, so use desktop Excel if an option is missing.
Related
- How to Find Duplicate Names in Excel Without Guessing
- How to Keep Track of Your Budget in Excel: Step by Step
- Wrap Text in Excel: Keep Long Cell Entries Visible
Try it: the Date Difference Calculator: days, months, years and weekdays between two dates, with the DATEDIF formulas.
More in How-to basics
- Box Plot in Excel: Example, Steps, and InterpretationIn Excel for Microsoft 365 on Windows, put each group of values in its own column, select the…
- Google Sheets COUNTIF: Count Non-Empty Cells in a RangeIf your entries are in A2:A100, count cells that are not empty in Google Sheets with =COUNTIF(A2:A100,"<>"). The…
- Remove All Formatting in Word Without Losing TextTo remove formatting from a Word document, save a copy, press Ctrl+A on Windows (Command+A on Mac), then…
- Create a Signature File in Outlook: Step-by-Step GuideTo create a signature file in classic Outlook for Windows, make the signature in Outlook first, then open…
- How to Create a Word Template with Fillable FieldsTo create a fillable Word template, add content controls from the Developer tab, set their properties, then save…
- How to Insert a Dotted Line in Word: 3 Easy MethodsTo insert a dotted line in Microsoft Word, use a paragraph border for a divider that stretches across…
Sources: Function behaviour and menu paths: Microsoft Support documentation for Excel. Method & sources
Spotted an error in this guide? Let us know.