Excel tutorial on locking cells and leaving colored input cells editable

Get the Excel Cell Protection Practice Workbook

Practice unlocking yellow input cells, protecting the rest of your worksheet, and moving between editable cells with Tab.

Set Up the Excel Input Sheet

The example is a worksheet where users should enter values only in yellow cells. The gray cells contain information we want to protect against accidental changes.

Excel project schedule with yellow input cells among gray protected cells

Once the yellow cells are unlocked and the worksheet is protected, you can press Tab to move from one editable cell to the next. Use Shift+Tab to move backward. This makes data entry easier even when the input cells are scattered across the worksheet.

Excel demonstration moving between yellow input cells using Tab

Protect and Unprotect an Excel Worksheet

By default, Excel cells have the Locked setting enabled. However, this setting only takes effect after you protect the worksheet. Go to Review > Protect Sheet to activate protection.

Excel Review tab with Protect Sheet command highlighted

You can add an optional password to prevent people from removing worksheet protection through the normal Excel commands. If you leave it blank, anyone can unprotect the sheet. A password must be confirmed when you first enter it.

Important: Sheet protection helps prevent unwanted changes, but it doesn’t encrypt your data. If you need to restrict who can open a workbook, see how to password protect an Excel file.

Protect Sheet dialog showing password entry and confirmation

Once protection is engaged, if you attempt to alter a cell’s content, you are presented with the following message.

Excel warning displayed when editing a protected cell

If you know the password, you can unprotect the sheet by selecting Review (tab) -> Protect (group) -> Unprotect Sheet.

Excel Review tab showing the Unprotect Sheet command

Unlock Specific Cells Before Protecting the Sheet

You can think of sheet protection as building a giant brick wall in front of the spreadsheet.  Suppose we need to exclude certain cells from the sheet protection to allow for data entry.

We just need to remove a few strategically located bricks to allow our changes to pass through.

Illustration of unlocking selected cells in a protected worksheet

Excel also has an Allow Edit Ranges feature for giving different people or groups permission to edit specific areas. For this example, we’ll use the simpler method: change the Locked setting for the cells that should remain editable.

Excel Review tab showing the Allow Edit Ranges command

This provides some useful features, such as assigning different passwords to different regions of the spreadsheet.

We will approach this from a simpler angle.  We simply wish to omit certain cells from the Protect Sheet feature.  We will begin by selecting the cells of which we want to allow editing.

Excel worksheet range selected for changing cell protection

Select the cells people should be allowed to edit. Press Ctrl+1 to open Format Cells, go to the Protection tab, and clear the Locked checkbox. Click OK.

Excel right-click menu with Format Cells selected

Select the Protection tab and uncheck the feature labeled Locked.

Format Cells Protection tab with the Locked checkbox cleared

Clearing the Locked checkbox doesn’t immediately stop or allow editing. The setting becomes active only when you protect the worksheet. Once protection is enabled, unlocked cells remain editable while locked cells cannot be changed.

For more options, including protecting formulas while leaving other cells editable, see our complete guide to locking and unlocking cells in Excel.

Once we activate the sheet protection feature, we can test the feature by attempting to alter the contents of a cell outside the prior cell selection.  We are denied access to the cell.  If we attempt to alter a cell in the previously selected range, we are allowed access.

The state of the Locked feature on the Protection tab in the Format Cells dialog box dictates the behavior of the cell when applying sheet protection.

Understand the Locked Checkbox States

When applying or removing a feature that uses checkboxes, you may observe the checkbox in one of three visual states.

A checked box means all selected cells have Locked enabled. An empty box means all selected cells are unlocked. A filled or gray box means the selection contains a mixture of locked and unlocked cells.

Excel Locked checkbox showing checked unchecked and mixed states

Unlock All Cells with a Specific Fill Color

Our goal is to protect everything except the yellow input cells. Selecting each yellow cell manually would take too long, especially in a large worksheet. Instead, we’ll use Find and Replace to select all matching cells at once.

Normally when we enter data into a cell and press the TAB key, the cursor moves one cell to the right.  When we apply sheet protection to all the cells except the yellow cells, pressing the TAB key will cause the cursor to move to the next unprotected cell. In this case, the next yellow cell.

This is a simple matter of unchecking the Protect feature for each yellow cell.

Some users would select each and remove the feature one at a time.  This not only tedious but also time-consuming in cases where there are dozens or hundreds of cells to adjust.

It doesn’t take long to realize that you can select the first cell, hold down the CTRL key and then select the remaining cells.  This is faster, but still tedious when working with many cells.

We want a FAST way to select ALL cells that are of a specific color.

Select only the part of the worksheet containing the input cells. This limits the search so you don’t accidentally unlock other yellow cells elsewhere on the sheet.

Find All Yellow Cells by Their Formatting

The first step is to highlight the range of cells that contain cells to be omitted from sheet protection.

Excel schedule with scattered yellow input cells

Press Ctrl+F, expand Options, then open the menu beside Format and choose Choose Format From Cell. Click one of the yellow input cells to use its formatting as the search criteria. Leave the Find what box empty when searching by formatting alone.

Excel Find and Replace menu showing Choose Format From Cell

Tip: Choose Format From Cell captures more than the fill color. It can also include fonts, borders and number formats, so differently formatted yellow cells may be missed. To search by fill color only, clear the previous format criteria, click Format, and specify the yellow color on the Fill tab.

For more ways to search and change formatting, see our Excel Find and Replace tutorial.

You will be presented with a standard cell selection cursor, but one with an additional image of an eyedropper to the right of the thick plus symbol.

Excel format picker selecting a yellow input cell

Place this cursor over any of the yellow cells and click.  The preview feature of the Find tool will display the cosmetic attributes of the selected cell.

Excel Find dialog showing a yellow cell formatting preview

Be aware that when selecting a reference cell with this technique we are not only capturing the color of the cell but ALL cosmetic setting s of the cell; font color, font style, font size, number formatting, bold, italic, underline, etc.

Click the Find All button at the bottom of the Find dialog box.  This will display a list of cells that possess the same cosmetic features as the reference cell.

Excel Find All results listing 52 cells with matching formatting

Click Find All. Then click inside the results list and press Ctrl+A to select every matching result. Close the Find and Replace dialog. The matching worksheet cells should remain selected.

Excel Find All results selected together using Ctrl+A

Unlock the Matching Cells

With the matching cells still selected, press Ctrl+1. On the Protection tab, clear Locked and click OK. Do not click another worksheet cell before changing the setting, or you’ll lose the multiple-cell selection.

Excel Protection tab showing Locked unchecked for matching cells

Click anywhere on the sheet to remove the sell selection.

If some input cells should accept only specific values, you can also add Excel drop-down lists using Data Validation.

Protect the Sheet and Test Your Input Cells

Apply sheet protection in the same manner as before: Review (tab) -> Protect (group) -> Protect Sheet.

To test the new behavior, select the first yellow cell and press the TAB key.  The cursor will jump immediately to the next yellow (unprotected) cell.

Excel demonstration moving between yellow input cells using Tab

If you press the TAB key too many times and skip a cell, you can hold the Shift key and press TAB to perform reverse navigation.

Move Between Unlocked Cells with Tab

On a protected worksheet, Tab normally moves between unlocked cells in worksheet order, from left to right and top to bottom. Shift+Tab moves backward. This lets you enter values across scattered input cells without repeatedly using the mouse.

Download the Lock and Unlock Cells Practice Workbook

Download the Cell Protection Practice Workbook

Get the Excel practice file and follow Leila’s example of unlocking input cells by color without using VBA.

Frequently Asked Questions

How do I lock all cells except input cells in Excel?

Select the cells users should be able to edit, press Ctrl+1, and clear Locked on the Protection tab. Then go to Review > Protect Sheet. The unlocked cells remain editable while the other cells are protected.

Why doesn’t the Locked checkbox work in Excel?

The Locked setting only takes effect when worksheet protection is enabled. Clearing the checkbox alone doesn’t change what users can edit. You must also activate Protect Sheet on the Review tab.

Can I unlock all yellow cells at once in Excel?

Yes. Select the relevant range, press Ctrl+F, open Options, and use Format to search for the yellow fill. Click Find All, select the matching results with Ctrl+A, then press Ctrl+1 and clear Locked on the Protection tab.

Why does Excel miss some cells with the same fill color?

Choose Format From Cell can capture font, borders, number formats and other settings in addition to the fill color. Clear the previous search formatting and specify only the desired fill color in the Find Format dialog.

How do I move between unlocked cells with the Tab key?

After protecting the worksheet, make sure Select unlocked cells is permitted. Press Tab to move to the next unlocked cell or Shift+Tab to move backward. Excel skips the locked cells during this navigation.

Does protecting an Excel worksheet keep confidential data secure?

No. Worksheet protection helps prevent unwanted edits, but it isn’t encryption. To prevent unauthorized people from opening a workbook, use Excel’s file-level password protection instead.

Leila Gharani

Founder of XelPlus and ten-time Microsoft MVP. Leila helps over 500,000 professionals master Excel, Power BI, and data automation through practical, real-world training.