How to Lock Cells in Excel
Protect formulas and headings from edits while leaving input cells open, by unlocking the editable cells and then protecting the sheet in Excel.
You want other people to fill in a few cells without touching the formulas around them. Every cell in Excel is already marked Locked, but that setting does nothing until the sheet is protected. The job is to unlock the cells that should stay editable, then turn on protection.
Select the cells that should stay editable
Click the first input cell, then hold Ctrl (Command on a Mac) and click each of the others. Whole rows or columns can be selected by clicking their headers.
Unlock those cells
Press Ctrl + 1 (Command + 1 on a Mac) to open Format Cells. Open the Protection tab, clear the Locked checkbox, and click OK. Nothing changes on screen yet. The same toggle is also under Home, Format, Lock Cell.
Protect the sheet
Go to Review, Protect Sheet. Type a password if you want one, or leave it blank to protect without a password. In the list below, tick what users are still allowed to do. The defaults let them select locked and unlocked cells but not change them. Click OK and retype the password if you set one.
Test it
Type into a cell you left locked. Excel shows a message saying the cell is protected. Type into one of the unlocked cells and the entry goes in. Press Tab to move between unlocked cells only.
Unprotect to make changes
Go to Review, Unprotect Sheet and enter the password. Edit the sheet, then protect it again. Protection is per sheet, so each sheet in the workbook is done separately.
If the password is lost. Excel has no recovery option. Keep a copy somewhere safe, or protect without a password when the goal is only to stop accidental edits.
If the data itself is confidential. Sheet protection stops edits, not reading. Anyone can open the file and copy the values. To require a password to open the file, use File, Info, Protect Workbook, Encrypt with Password. To hide a formula from the formula bar on a protected sheet, tick Hidden next to Locked on the Protection tab before protecting.
More Excel how-tos
- How to Add a Drop-Down List in Excel
- How to Add a Line Break in an Excel Cell
- How to Convert Text to Numbers in Excel
- How to Create a Pivot Table in Excel
- How to Freeze Panes in Excel
- How to Make a Chart in Excel
- How to Merge Cells in Excel
- How to Remove Duplicates in Excel
- How to Split Text into Columns in Excel
- How to Sum a Column in Excel
- How to Use COUNTIF in Excel
- How to Use SUMIF in Excel
- How to Use the IF Function in Excel
- How to Use VLOOKUP in Excel
- How to Use XLOOKUP in Excel