How to Lock Cells in Excel: A Simple Step-by-Step Guide

If you share an Excel spreadsheet with other people, you may want them to enter information in certain cells without accidentally changing formulas, labels, or important data. Excel lets you do this by locking cells and then protecting the worksheet.

The important part is that locking a cell alone does not prevent editing. You also need to turn on Protect Sheet.

This guide explains how to lock specific cells, protect an entire worksheet, protect formulas, allow selected editing actions, and unlock cells later.

Also read: How to Make a Pie Chart in Excel

How Cell Locking Works in Excel

Excel cells have a Locked property by default. However, this setting has no practical effect until worksheet protection is enabled.

For example, suppose you have a worksheet with:

  • Product names in column A
  • Prices in column B
  • Quantities that users need to enter in column C
  • Formulas calculating totals in column D

You can leave column C editable while protecting the formulas and other important information.

The basic process is:

  1. Unlock the cells that people should be able to edit.
  2. Keep the cells you want to protect locked.
  3. Turn on Protect Sheet.

How to Lock Specific Cells in Excel

These steps apply to Excel on Windows.

Step 1: Unlock the cells that should remain editable

First, select the entire worksheet.

Press Ctrl + A. If Excel selects only the current data area, press Ctrl + A again to select the whole sheet.

Then:

  1. Press Ctrl + 1 to open Format Cells.
  2. Select the Protection tab.
  3. Clear the Locked checkbox.
  4. Select OK.

At this point, all cells are unlocked.

Step 2: Select the cells you want to protect

Select the cells that should not be changed.

To select separate cells or ranges, hold Ctrl while making your selections.

Step 3: Lock those cells

With the cells selected:

  1. Press Ctrl + 1.
  2. Open the Protection tab.
  3. Check Locked.
  4. Select OK.

Step 4: Protect the worksheet

Go to Review > Protect Sheet.

Excel will display protection options. You can:

  • Set a password
  • Decide what users are allowed to do
  • Control whether users can select locked or unlocked cells
  • Allow actions such as filtering or sorting where applicable

Select OK when you’re finished.

Now the cells you locked cannot be edited, while the cells you left unlocked remain available for data entry.

Do You Need a Password?

No. A password is optional.

However, without a password, someone who can edit the workbook can simply choose Unprotect Sheet and change the worksheet protection settings.

If you use a password, keep it somewhere safe. Losing it can make it difficult to change the protection later.

How to Lock the Entire Excel Worksheet

If you want to prevent users from editing the entire sheet, you don’t need to change the Locked setting for individual cells.

Excel cells are locked by default.

Simply:

  1. Open the Review tab.
  2. Select Protect Sheet.
  3. Choose the actions users should still be allowed to perform.
  4. Add a password if required.
  5. Select OK.

The worksheet is now protected.

If your goal is also to prevent people from adding, deleting, moving, hiding, or renaming worksheets, use Protect Workbook as well. Worksheet protection and workbook protection control different things.

How to Lock Only Formula Cells

Protecting formulas is useful when other people need to enter values but shouldn’t accidentally overwrite calculations.

For example, you might have a worksheet where users enter quantities and prices, while Excel calculates totals automatically.

Here’s how to protect only the formulas:

  1. Select the entire worksheet with Ctrl + A.
  2. Press Ctrl + 1.
  3. Open Protection.
  4. Clear Locked.
  5. Select OK.
  6. Go to Home > Find & Select > Go To Special.
  7. Select Formulas.
  8. Select OK.

Excel will select the cells containing formulas.

Next:

  1. Press Ctrl + 1.
  2. Open Protection.
  3. Check Locked.
  4. Select OK.
  5. Go to Review > Protect Sheet.
  6. Configure the permissions and select OK.

The formula cells are now protected, while other cells remain editable.

How to Choose What Users Can Do on a Protected Sheet

When you select Protect Sheet, Excel provides several permissions.

Depending on your needs, you can allow users to:

  • Select locked cells
  • Select unlocked cells
  • Format cells
  • Format rows or columns
  • Insert rows or columns
  • Delete rows or columns
  • Sort data
  • Use existing AutoFilter controls
  • Work with PivotTable reports
  • Edit certain objects

For a simple data-entry worksheet, you may want users to select only unlocked cells. This makes it easier for them to move between the fields they are supposed to complete.

What Happens If You Disable “Select Locked Cells”?

Users won’t be able to click protected cells at all. This can make a form-style spreadsheet easier to use because people can move directly between the fields they are expected to fill in.

How to Let Specific People Edit a Protected Range

Excel for Windows also has an Allow Edit Ranges feature.

This can be useful when most of a worksheet should remain protected but particular people need permission to edit a certain range.

Before protecting the worksheet:

  1. Open Review.
  2. Select Allow Edit Ranges.
  3. Select New.
  4. Give the range a name.
  5. Enter the cells that should be editable.
  6. Add a range password if needed.
  7. Alternatively, use Permissions to specify people who can edit the range when supported by your organization’s network setup.
  8. Select OK.
  9. Protect the worksheet.

If you’re working on a personal computer rather than a suitable work or school domain, a range password may be the more practical option.

How to Lock Cells in Excel on Mac

The process is similar in Excel for Mac, although some commands are named or positioned differently.

  1. Select the cells that users should be able to edit.
  2. Press Command + 1 or open Format > Cells.
  3. Select Protection.
  4. Clear Locked.
  5. Select OK.
  6. Open Review > Protect Sheet.
  7. Choose the actions users can perform.
  8. Add and confirm a password if needed.
  9. Select OK.

Excel for Mac has some differences in its protection options and labels, so the exact interface can vary by version.

How to Lock Cells in Excel for the Web

Excel for the web handles worksheet protection somewhat differently from the desktop application.

Open the worksheet and go to:

Review > Manage Protection

Turn on Protect sheet.

You can then specify Unlocked ranges for cells that users should still be able to edit. The protection settings are managed through the protection pane.

If you need desktop-only features such as certain Allow Edit Ranges permissions, you may need to open the workbook in the desktop version of Excel.

How to Test Cell Protection

Don’t assume the protection is working just because the worksheet appears protected. Test it before sharing the file.

Try the following:

  1. Click a locked cell.
  2. Try to change its contents.
  3. Confirm that Excel prevents the change.
  4. Click an unlocked cell.
  5. Enter some test data.
  6. Confirm that the change is allowed.
  7. Check the Review tab to make sure Protect Sheet has changed to Unprotect Sheet.

Testing both types of cells helps catch mistakes before someone else uses the spreadsheet.

How to Unlock Cells Again

If you need to modify the worksheet:

  1. Go to Review.
  2. Select Unprotect Sheet.
  3. Enter the password if one was set.

Once the sheet is unprotected, you can change the Locked setting for individual cells.

Select the cells, press Ctrl + 1, open the Protection tab, and change the Locked checkbox as needed.

You can then protect the worksheet again.

If you’ve forgotten the protection password, Microsoft does not provide a way to retrieve it. Keeping an earlier, unprotected copy can be important when you manage password-protected worksheets.

Can You Hide Formulas in Locked Cells?

Yes. Excel also provides a Hidden option in the Protection tab.

To hide a formula:

  1. Select the formula cells.
  2. Press Ctrl + 1.
  3. Open Protection.
  4. Check Hidden.
  5. Make sure the cells are also locked.
  6. Protect the worksheet.

The formula result remains visible in the cell, but the formula is no longer displayed in the formula bar while the sheet is protected.

Locking Cells Is Not the Same as Securing the File

This distinction is important.

Worksheet protection is mainly designed to prevent unwanted changes to a worksheet. It isn’t the same as encrypting a file or protecting sensitive information.

Someone who can open the workbook may still be able to read the information on a protected worksheet.

Excel has different protection levels for different purposes:

Protection typeMain purpose
Worksheet protectionControls what users can change on a particular sheet
Workbook protectionControls changes to the workbook’s sheet structure
File protectionControls access to the workbook itself

If a spreadsheet contains confidential information, cell locking should not be treated as a substitute for appropriate file-level security.

Common Problems With Locked Cells

Locked cells can still be edited

The cells may be marked as locked, but the worksheet probably isn’t protected.

Go to Review > Protect Sheet.

Users can’t type in the cells they need

You may have protected the sheet while leaving every cell locked.

Unprotect the sheet, unlock the cells intended for data entry, and protect the sheet again.

The Locked option is already selected

That’s normal. Excel marks cells as locked by default.

The setting becomes effective only after you protect the worksheet.

Allow Edit Ranges is unavailable

The worksheet may already be protected.

Choose Review > Unprotect Sheet, make your changes, and configure protection again.

Format Cells is unavailable

Worksheet protection can prevent you from changing cell protection settings.

Unprotect the worksheet first.

Sorting doesn’t work

Make sure Sort is enabled in the Protect Sheet settings.

There is also an important limitation: sorting may still be blocked when the relevant range contains locked cells.

Filtering doesn’t work

Enable the appropriate filter option when protecting the sheet. Existing filter controls may also need to be in place before protection is enabled.

Frequently Asked Questions

Can I lock cells without protecting the worksheet?

No. The Locked property by itself doesn’t prevent editing. You must also enable Protect Sheet.

Can I lock a whole column?

Yes. First configure the worksheet so that the cells you don’t want protected are unlocked. Then select the column, open Format Cells > Protection, select Locked, and protect the worksheet.

Can I lock a whole row?

Yes. Select the row, set its cells to Locked, and then protect the worksheet.

Can people see locked cells?

Yes. Locking a cell prevents changes; it doesn’t automatically hide the cell’s contents.

Can I lock formulas but allow users to change input values?

Yes. Unlock the input cells, identify the formula cells, lock those formula cells, and then protect the worksheet.

Can I still sort or filter a protected sheet?

Sometimes. Excel lets you enable sorting and filtering through the protection settings, but there are limitations. For example, sorting can be restricted when the range contains locked cells.

Is locking a cell reference the same as locking an Excel cell?

No. These are two different features.
When you write a formula such as =$A$1, the dollar signs create an absolute cell reference. They prevent the reference from changing when you copy the formula.
Cell locking, on the other hand, controls whether someone can edit a cell on a protected worksheet.

Also read: How to Use VLOOKUP in Excel: A Practical Guide With Examples

Final Thoughts

The easiest way to think about Excel cell protection is to separate it into two steps: set which cells are locked, then protect the worksheet.

For a simple protected form, unlock the cells where users need to enter information and protect everything else. For calculation-heavy worksheets, locking formula cells can prevent accidental changes while keeping input fields editable.

Before sharing the workbook, test both a protected cell and an editable cell. Also remember that worksheet protection is intended to control editing, not to provide strong security for confidential data.

Leave a Comment