Smart Systems for Home

Plain how-to guides for smart home, security and home Wi-Fi

How to Lock Excel: Protect Sheets and Workbooks

· 7 min read · Home Tech

In this article
  1. What You'll Need
  2. Step-by-Step
  3. Common Mistakes
  4. Tips
  5. Troubleshooting
  6. Frequently Asked Questions

To lock an Excel file, you can either encrypt the entire workbook with a password or protect specific sheets to prevent users from editing certain cells. To lock the entire file, go to File > Info > Protect Workbook > Encrypt with Password. To lock a specific sheet, go to the Review tab and select Protect Sheet. These methods ensure that your sensitive data remains secure and that formulas or layout structures are not accidentally altered by other users. Note that menu labels may differ slightly depending on your version of Excel (Office 365, 2021, 2019) or your operating system.

What You'll Need

  • A computer with Microsoft Excel installed.
  • A secure password that you can remember (Excel passwords are case-sensitive and cannot be recovered by Microsoft if lost).
  • A clear understanding of which parts of the spreadsheet need to be read-only and which need to remain editable.

Step-by-Step

Method 1: Locking the Entire Workbook (Password Protection)

This method is used when you want to prevent unauthorized people from opening the file at all. The file will be encrypted, and a password prompt will appear immediately upon launch.

  1. Open the Excel workbook you wish to lock.
  2. Click on the File tab in the top-left corner of the ribbon.
  3. Select Info from the left-hand sidebar menu.
  4. Click the Protect Workbook button. This will open a dropdown menu of several protection options.
  5. Select Encrypt with Password.
  6. A dialog box will appear asking you to enter a password. Type your chosen password and click OK.
  7. Excel will ask you to re-enter the password to confirm it is correct. Type it again and click OK.
  8. Save the workbook by clicking the Save icon or pressing Ctrl + S. The encryption is not active until the file is saved.

Method 2: Locking Specific Cells or Sheets (Preventing Edits)

By default, every cell in an Excel worksheet is marked as "Locked," but this setting has no effect until the sheet itself is protected. To allow users to enter data in some cells while locking others, you must first unlock the editable cells.

  1. Open the worksheet you want to partially lock.
  2. Select the specific cells, rows, or columns that you want users to be able to edit.
  3. Right-click the selected cells and choose Format Cells (or press Ctrl + 1).
  4. In the Format Cells window, click on the Protection tab.
  5. Uncheck the box labeled Locked. Click OK. Now, these specific cells are exempt from the upcoming lock.
  6. Go to the Review tab on the top ribbon.
  7. Click Protect Sheet.
  8. A dialog box will appear. You can enter an optional password here. If you leave it blank, anyone can unprotect the sheet, but the lock will still prevent accidental typing.
  9. In the list "Allow all users of this worksheet to:", check the boxes for the actions you want to permit. For example, you might allow "Select locked cells" but uncheck "Format cells".
  10. Click OK. If you set a password, you will be asked to confirm it.

Method 3: Locking the Workbook Structure

This prevents users from adding, deleting, renaming, moving, or hiding worksheets within the file, though they can still edit the data within the sheets themselves.

  1. Go to the Review tab.
  2. Click Protect Workbook.
  3. In the dialog box, ensure the Structure checkbox is selected.
  4. Enter a password if you wish to prevent others from removing the protection.
  5. Click OK and confirm the password if prompted.
  6. Save the file to apply the changes.

Common Mistakes

One of the most frequent errors is forgetting to unlock specific cells before protecting the sheet. Because Excel defaults all cells to "Locked," clicking Protect Sheet without first designating editable areas will make the entire page read-only, leaving no room for data entry. This often leads to confusion when users find they cannot type anywhere in the document.

Another common mistake is losing the password. Microsoft does not provide a "Forgot Password" or recovery service for Excel encryption. If the password for an encrypted workbook is lost, the data is effectively inaccessible. Many users mistakenly believe that the password used to sign into their Microsoft Account is the same as the workbook password; these are entirely separate.

Users also frequently forget to save the file after applying a password. If you encrypt a workbook and then close it without saving, the file remains unlocked. Always check for the save prompt or manually save your progress after modifying security settings.

Finally, some users confuse "Protect Sheet" with "Protect Workbook." Protecting a sheet only locks the cells on that specific tab. Protecting the workbook locks the arrangement of the tabs. To fully secure a file, you may need to use a combination of both, plus the File > Info encryption method.

Tips

To maintain a professional workflow, use a password manager to store your Excel passwords. Since these passwords are case-sensitive, a single capitalization error will lock you out of your own data. Recording the password in a secure, external vault is highly recommended.

When protecting sheets, consider the "Allow users to edit ranges" feature found in the Review tab. This allows you to set different passwords for different ranges of cells, enabling multiple collaborators to edit their own specific sections of a master sheet without having access to the rest of the data.

If you are sharing a file for data collection, provide a clear instruction at the top of the sheet (e.g., "Please enter data in the yellow cells only"). You can format the unlocked cells with a specific fill color so users know exactly where they are permitted to type.

For those who need to protect formulas but allow users to see the results, go to Format Cells > Protection and check the Hidden box. Once the sheet is protected, the formulas will no longer be visible in the formula bar, although the calculated result remains visible in the cell.

Troubleshooting

If you find that you cannot edit a cell even after you thought you unlocked it, first check if the entire workbook is marked as "Read-Only." Look at the top of the window next to the file name; if it says [Read-Only], you may need to save a copy of the file to your local drive before you can make changes.

If the Protect Sheet button is greyed out, check if the workbook is shared or if you are currently in "Cell Edit Mode" (where the cursor is blinking inside a cell). Press Enter or Esc to exit the cell and try again. If the file is shared via a legacy "Shared Workbook" feature, some protection options are disabled until you unshare the document.

If you have entered the correct password but Excel still won't open the file, check your Caps Lock key. Because passwords are case-sensitive, this is the most common cause of login failure. If the file is stored on a network drive or cloud service like OneDrive, try downloading a local copy to your desktop to rule out synchronization or permission errors.

In cases where you cannot unlock a sheet because the previous owner forgot the password, there is no official Microsoft tool to recover it. You may try to copy the data by selecting the entire sheet and pasting it into a new workbook, though this often fails if the cells are strictly locked. The only reliable solution is to obtain the original password.

Frequently Asked Questions

Can I lock only certain cells and leave others open?

Yes. You must select the cells you want to stay open, go to Format Cells > Protection, and uncheck "Locked." After that, you must apply the Protect Sheet setting from the Review tab.

What is the difference between a Workbook password and a Sheet password?

A Workbook password (via File > Info) prevents anyone from opening the file. A Sheet password prevents users from changing the content of a specific tab but allows them to open and view the file.

Can I lock an Excel file without a password?

Yes. If you use Protect Sheet or Protect Workbook without entering a password, the lock is active, but any user can click "Unprotect" to disable it. This is useful for preventing accidental edits rather than preventing intentional ones.

Will locking my Excel file make it smaller?

No, locking or encrypting a file does not significantly change the file size. In some cases, encryption may slightly increase the size due to the added security metadata, but the difference is negligible.

Does locking a sheet protect it from being deleted?

Protecting a sheet prevents the editing of cells within that sheet. To prevent the entire sheet (the tab) from being deleted, you must use the Protect Workbook feature on the Review tab.

Can I lock a file so it can only be opened on one computer?

Excel does not have a built-in feature to lock a file to a specific hardware ID or computer. Password protection is the primary method for controlling access regardless of the device used.