Locking cells in Excel worksheets is an important step to protect your data and formulas from unwanted changes. By locking cells, you can restrict editing to only certain parts of the worksheet.
There are a few ways to lock cells in Excel:
Table of Contents
Lock All Cells in the Worksheet
By default, all cells are locked when you protect a worksheet. This prevents anyone from editing any cells.
Lock Specific Cells or Ranges
You can unlock specific cells before protecting the sheet. This allows editing of only those unlocked cells.
Set Editing Permissions
When protecting a sheet, you can specify what actions users are allowed to perform, like filtering or sorting.
Steps to Lock Cells in Excel
Follow these steps to lock cells in an Excel worksheet:
1. Select Cells to Lock/Unlock
First, select the cells you want to lock or unlock. To unlock cells, uncheck the Locked option in the Format Cells dialog.
2. Protect the Worksheet
On the Review tab, click Protect Sheet. Enter a password if desired and check allowed actions.
3. Unprotect to Edit
To edit locked cells, unprotect the sheet, make edits, then re-protect the sheet after.
Lock All Cells in a Protected Worksheet
Here are the detailed steps to lock all cells in a worksheet:
- Select all cells (Ctrl+A)
- On the Home tab, open the Format Cells dialog
- On the Protection tab, check the Locked option
- Click OK
- On the Review tab, click Protect Sheet
- Enter a password (optional), check allowed actions
- Click OK
Now all cells in the worksheet are locked from editing. To edit cells, unprotect the sheet first.
Lock Specific Cells in a Protected Worksheet
To allow editing of some cells, while locking others:
- Select all cells and unlock them
- Select specific cells/ranges to lock
- Check Locked option in Format Cells dialog for those cells
- Protect sheet and specify allowed actions
- Those locked cells cannot be edited now
You can also unlock cells after protecting a sheet from the Unprotect Sheet dialog.
Set Editing Permissions in Protected Sheets
When protecting a worksheet in Excel, you can specify what actions users are allowed to perform:
- Select locked/unlocked cells
- Format cells, rows, columns
- Sort, filter, use pivot tables
- Edit objects, scenarios, sparklines
Check or uncheck those options before protecting the sheet.
Tips for Locking Cells in Excel
Here are some additional tips for locking cells:
- Add a password when protecting sheets to prevent turning off protection
- Lock cells containing formulas to prevent formula edits or tampering
- Allow filtering/sorting if you want users to work with data without editing it
- Unlock only cells you want users to edit before protecting sheet
Conclusion
Locking cells in Excel worksheets is important to:
- Protect sensitive data and formulas
- Prevent accidental edits to important cells
- Enable editing but restrict it only to certain cells
By locking all or specific cells in a protected worksheet, you can have more control over edits to your Excel worksheets.
Summary
- Lock cells by checking Locked option in Format Cells dialog
- Protect sheet to activate protection on locked cells
- Specify editing permissions – allowed actions on protected sheet
- Add password to prevent turning off protection
- Unlock only cells you want users to edit before protecting