How to lock cells in Excel
Excel is a widely used spreadsheet software around the world. One of its most important features is the ability to lock cells, which allows users to protect sensitive data and prevent accidental changes.
However, many users do not know how to lock cells in Excel or have difficulty doing so. In this article, we will guide you step-by-step through the process of locking cells in Excel and provide you with some practical examples to improve your understanding.
What does it mean to lock a cell?
Locking a cell in Excel means preventing it from being accidentally modified. This can be particularly important when working with sensitive data or when you want to protect formulas that are located in cells.
When you lock a cell, Excel prevents the user from changing the contents of the cell or moving it to the wrong position. However, it is still possible to view the contents of the cell and use it in formulas.
- Note: Locking a cell does not necessarily mean protecting it with a password or encrypting it. If you need additional security, you should consider using other data protection options available in Excel.
Method 1: Locking cells using the Format Cells menu
The most common method for locking cells in Excel is by using the Format Cells menu. This method is very simple and does not require the use of formulas or VBA code.
Step 1: Select the cells to be locked
First, select the cells that you want to lock. You can select a single cell or a group of cells.
Step 2: Open the Format Cells menu
After selecting the cells to be locked, right-click on one of the selected cells. In the drop-down menu that appears, select "Format Cells".
Step 3: Choose the Protection tab
In the Format Cells dialog box, choose the "Protection" tab. This tab allows you to set various protection options for the selected cells.
Step 4: Enable cell protection
In the Protection tab, enable the "Locked" option to prevent modification of the selected cells. Also, enable the "Hidden" option to hide the contents of the cells.
Step 5: Protect the worksheet
After setting cell protection options, protect the worksheet to prevent modification of locked cells. To do this, click on the "Review" tab and select "Protect Sheet".
Once you have protected the worksheet, the selected cells will be locked and their content or formatting cannot be modified without first unlocking them.
Method 3: Protecting cells using a password
If you want to protect your cells so that only those who know the password can modify them, follow these steps:
- Select all of the cells that need protection.
- Navigate to 'Format Cells' by right-clicking on the selected cells.
- Click on the 'Protection' tab and check the 'Locked' box. You can also select the 'Hidden' option to hide the contents of the cell.
- Click 'OK' and then navigate to 'Review' and select 'Protect Sheet.'
- Select a password and click 'OK.'
- Select the cells you want to protect.
- Right-click and select "Format Cells".
- In the "Format Cells" dialog box, go to the "Protection" tab.
- Select the "Locked" option to prevent changes to the selected cells.
- Enter a password in the "Password" box and confirm it in the "Confirm Password" box.
- Click "OK" to confirm the changes.
Now, when someone tries to edit the protected cells, they will be prompted for the password you set. Without the correct password, no changes can be made to the protected cells.
Note that if you want to protect the entire worksheet instead of individual cells, you will need to select the entire sheet before following the above steps.
This method is useful if you need to share your worksheet with others but want to keep some information confidential or sensitive. For example, you may want to protect formulas or financial data so that only those with the password can access it.
How to unlock protected cells
If you need to edit a protected cell in an Excel worksheet, you can follow these steps to unlock it:
- Select the cell or cells you want to unlock.
- Right-click on the selection and choose "Format Cells".
- In the "Format Cells" window, go to the "Protection" tab.
- Clear the "Locked" checkbox and click OK.
Now the selected cells have been unlocked and you can edit the data as desired. However, to safeguard your data, it is important to restore cell protection after making any necessary changes.
To restore cell protection, follow these steps:
- Select the cells you want to protect again.
- Right-click on the selection and choose "Format Cells".
- In the "Format Cells" window, go to the "Protection" tab.
- Select the "Locked" checkbox and click OK.
This way, your changes will be saved but your cells will still be protected from accidental errors or unauthorized changes.
Remember that if the worksheet is password-protected, you will need to enter the password to unlock or protect cells.
Conclusion
Locking cells in Excel is a very useful operation for protecting data and preventing accidental changes. With the right settings, you can lock the entire sheet or only specific cells.
In this article we have seen how to lock cells in Excel using the worksheet protection feature and conditional formatting. The first option is useful if you want to protect the entire sheet, while the second is ideal for locking only certain cells.
Remember that to unlock protected cells, you will need to enter a password. Make sure to choose a secure password and remember it well.
In addition, keep in mind that locking cells does not guarantee complete data security. If you need to protect particularly sensitive information, consider using encryption tools or specialized software.
- To recap:
- - To lock cells in Excel, use the sheet protection function or conditional formatting;
- - Remember to set a password to unlock protected cells;
- - Locking cells does not guarantee complete data security.
We hope this article has been helpful for learning how to lock cells in Excel. If you have any questions or suggestions, leave a comment below!

Michael Anderson - Software Engineer
My name is Michael Anderson, and I work as a computer engineer in Midland, Texas.
My passion is sharing my knowledge in various areas, and my purpose is to make education accessible to everyone. I believe it is essential to explain complex concepts in a simple and interesting way.
With GlobalHowTo, I aim to motivate and enrich the minds of those who want to learn.





