To protect an Excel sheet while leaving certain cells editable, select those cells, open Format Cells with Ctrl+1, clear the Locked check box on the Protection tab, and then choose Review > Protect Sheet. Excel locks cells by default, but that setting only prevents edits after sheet protection is turned on.
How worksheet protection works
Excel treats a cell’s Locked setting as an instruction for what to protect, not as a restriction that operates by itself. In a new worksheet, cells are generally marked as locked. You can still edit them until you protect the sheet. Once protection is active, locked cells cannot normally be changed, while unlocked cells remain available for data entry.
This arrangement is useful for forms, budgets, trackers, and shared templates. For example, a monthly expense sheet might contain formulas for totals in column E, headings in row 1, and blank entry cells in columns A through D. You can keep the headings and formulas locked, unlock the input area, and protect the sheet. People can enter expenses without accidentally replacing the calculation in a total cell.
Protection applies to a worksheet, not automatically to every sheet in a workbook. If a workbook has several sheets that need protection, configure each one separately. Worksheet protection is also different from protecting the workbook’s structure or requiring a password to open the file.
Unlock specific cells before protecting the sheet
In Excel for Microsoft 365 on Windows, first identify every cell users should be able to edit. You can select a continuous block by dragging across it or by clicking the first cell and Shift-clicking the last. To select separate cells or ranges, hold Ctrl while clicking or selecting each range. Then change the selected cells’ Locked setting:
- Select the cells that should remain editable.
- Press Ctrl+1 to open the Format Cells dialog.
- Choose the Protection tab.
- Clear Locked, then select OK.
- Choose Review > Protect Sheet.
In the Protect Sheet dialog, you can enter a password or leave the password field blank. Choose the actions users should be allowed to perform, such as selecting unlocked cells, and select OK. If you entered a password, Excel asks you to confirm it. Keep a record of any password you choose: Excel does not provide a simple password-recovery option for protected sheets.
On Excel for Mac, the same approach applies: change the cell setting in the Format Cells dialog, then use the protection command on the Review tab. The precise dialog appearance can differ by platform and update. In Excel for the web, protection controls are available through Review; the available controls and layout can differ from the Windows desktop dialog.
Protect everything except a small input area
For the common case where only a handful of cells should be editable, leave the rest of the sheet locked and unlock just the input cells. This is usually the simplest setup because Excel’s default Locked setting already applies to most cells in a new worksheet. For example, if a form uses B3:B8 for user entries and the rest of the sheet contains labels and calculations, select B3:B8 and clear Locked before protecting the sheet.
Before enabling protection, check the selected cells carefully. Accidentally including a formula cell in the unlocked range means users can overwrite that formula. Conversely, forgetting to unlock one input cell can make a form appear broken because Excel will reject an entry there after protection is enabled. A useful check is to inspect the intended input ranges before protecting, then test both an input cell and a formula cell afterward.
If a worksheet has been customized before, do not assume every cell is still locked. Previous users may have unlocked additional ranges. Select a cell and open Format Cells > Protection to check its setting, or review the relevant ranges systematically before protecting the sheet.
Protect formulas while leaving most cells editable
Sometimes the opposite selection strategy is easier: users can edit almost the whole sheet, but formula cells must stay protected. In that case, first make the intended editable cells unlocked, then ensure formula cells are locked and turn on sheet protection. Excel’s Find & Select > Go To Special command can help locate cells that contain formulas: choose Formulas in the Go To Special dialog, then use Format Cells to confirm that Locked is selected for the results.
Be aware that selecting formula cells this way may find formulas across the worksheet, including formulas you did not intend to protect. Review the selection before changing cell settings. Also, locking formulas prevents ordinary edits to those cells; it does not hide the formula from someone who can select the cell and view the formula bar. To hide a formula as well, select the cell, open Format Cells > Protection, select Hidden, and then protect the sheet. The Hidden setting takes effect only while sheet protection is active.
Choose the right permissions in Protect Sheet
The Protect Sheet dialog lets you decide what users can do while protection is on. For a basic data-entry form, allowing users to select unlocked cells is usually important. You can also allow selection of locked cells, formatting, inserting or deleting rows, sorting, filtering, or other listed actions as needed. Avoid enabling permissions simply because they are available; each one changes what users can do on the protected sheet.
For instance, a worksheet with an existing filter may need the Use AutoFilter permission so users can operate that filter. A sheet that must remain a fixed form may need neither row insertion nor column deletion. Sorting protected data can have limitations, particularly when the sort range includes locked cells, so test the actual arrangement rather than assuming the permission will make every sort possible.
- Allow selection of unlocked cells if users need to enter data in the permitted areas.
- Allow formatting only if users should be able to change cell appearance or dimensions.
- Allow filtering or sorting only when those actions are part of the intended workflow.
- Consider whether inserting or deleting rows could disrupt formulas, references, or the layout.
These permissions do not make the sheet a secure database or guarantee that formulas are correct. They are controls against changes made through Excel’s normal worksheet interface.
Passwords, security, and workbook protection
A sheet-protection password helps prevent people from casually changing protection settings or editing locked cells. It is not the same as encrypting a workbook. Microsoft describes worksheet protection as a way to prevent modification of locked cells, not as a security feature for safeguarding sensitive information. Do not rely on it to keep confidential data secret from someone who can access the workbook.
If the goal is to restrict who can open a file, use file-level encryption instead. In desktop Excel for Windows, the password-to-open control is under File > Info > Protect Workbook > Encrypt with Password. Protecting workbook structure is another separate feature, intended to restrict changes such as adding, deleting, moving, or renaming sheets. Choose the feature that matches the problem: sheet protection for controlling edits within a worksheet, structure protection for workbook organization, and file encryption for access control.
Because forgotten protection passwords can be difficult to recover, document them in an appropriate password manager or organizational process. Before protecting a business-critical template, keep an editable backup. This also makes it easier to update formulas and layouts later without relying on a password that may be lost.
Test the protected sheet and remove protection
After protecting the sheet, test the result as an ordinary user would. Try entering a value in each kind of input area, then try changing a locked heading or formula cell. Confirm that allowed actions such as filtering still work and that prohibited actions are blocked. A short test catches mistakes such as an input range left locked or a formula accidentally left editable.
To change the setup later in Excel for Windows, choose Review > Unprotect Sheet. If the sheet has a password, enter it when prompted. Then adjust the Locked or Hidden settings through Format Cells and protect the sheet again. Unprotecting a sheet does not erase the cell settings; it temporarily stops those settings from restricting edits. Once protection is turned back on, the settings take effect again.
Common problems and misconceptions
Clearing Locked did not protect the other cells. That is expected if you have not turned on sheet protection. Locked and Hidden are cell properties whose effects depend on protection being active.
I can still see a formula. Locked prevents editing, not viewing. To hide a formula from the formula bar, set Hidden for the cell and then protect the sheet. This is still not a substitute for file security.
Users cannot type in a cell that should be editable. Check that you unlocked the correct cell before protecting the sheet. Also check whether the user is selecting a different cell than expected, or whether another restriction, such as a data-validation rule, rejects the entry.
The password does not encrypt the workbook. A worksheet password governs editing restrictions on that sheet. It does not stop someone with access to the file from viewing its contents in the way file encryption is intended to do.
Frequently Asked Questions
How do I protect an Excel sheet but allow editing in certain cells? Select the cells, press Ctrl+1, clear Locked on the Protection tab, and select OK. Then choose Review > Protect Sheet and set the permissions you want.
Are Excel cells locked by default? In a new worksheet, cells are generally marked as locked by default. They remain editable until sheet protection is enabled, which is why changing the Locked setting alone does not prevent editing.
Can I protect cells without a password? Yes. You can protect a sheet without entering a password. The protection still restricts edits according to the selected options, but anyone who can access the sheet may be able to remove protection without a password.
Can users see formulas in protected cells? Yes, unless you also set the cells’ Hidden property before protecting the sheet. Even then, worksheet protection is not designed to secure confidential information.
Can I unlock several separate cells at once? Yes. Select multiple cells or ranges, including nonadjacent selections made with Ctrl on Windows, and clear Locked once in Format Cells. Check the selection carefully before applying the change.
Related
- Excel Text to Columns by Word: Methods That Work
- Excel Text to Columns: How to Keep Leading Zeros Safely
- Excel Table Dropdown List: Create and Manage Lists
Try it: the Date Difference Calculator: days, months, years and weekdays between two dates, with the DATEDIF formulas.
More in How-to basics
- How to Share a Personal Calendar in Outlook on Any DeviceTo share a personal calendar in Outlook, open Calendar, choose the calendar’s sharing option, add the recipient, select…
- Excel Insert Row With Same Formatting: Best MethodsTo insert a row in Excel and keep the surrounding formatting, select the row number where the new…
- Set Out of Office in Outlook for Mac: A Step-by-Step GuideTo set an out-of-office reply in Outlook for Mac, open Tools > Automatic Replies, choose your Exchange or…
- How to Add a Comma Between Footnote References in WordTo add a comma between consecutive footnote references in Word, place the insertion point between the two superscript…
- Excel Shortcut to Copy Down: Ctrl+D ExplainedIn Excel for Microsoft 365 on Windows, select the range you want to fill, including the cell at…
- Excel Consolidate Lists With Duplicates: Keep or Remove?To combine lists and keep repeated items in Excel for Microsoft 365 on Windows, enter =VSTACK(A2:A5,B2:B4) in an…
Sources: Function behaviour and menu paths: Microsoft Support documentation for Excel. Method & sources
Spotted an error in this guide? Let us know.