If you want to prevent editing in certain cells, you can lock these cells. By default, all cells in an Excel worksheet are locked, but this does not take effect until you protect the worksheet. Here's how you can lock specific cells:
Unlock all cells
Select all cells in the worksheet by clicking the corner of the worksheet or pressing Ctrl+A
.
Right-click and select Format Cells
.
Click on the Protection
tab, uncheck the Locked
option, and click OK
.
Lock specific cells
Select the cells you want to lock.
Right-click and select Format Cells
.
Click on the Protection
tab, check the Locked
option, and click OK
.
Protect the worksheet
Go to the Review
tab on the ribbon.
Click Protect Sheet
.
Enter a password if desired (optional, but remember it if you do, you will need it to unprotect the sheet), ensure Protect worksheet and contents of locked cells
is checked, and then click OK
.
Now, users will not be able to edit the locked cells, but they will still be able to edit the other cells. Be aware that if you lock a cell, it won't be possible for users to enter data or change the existing data in that cell, unless the worksheet protection is removed.
Also, keep in mind that this is not a high-security measure, it's mainly intended to prevent accidental changes. A knowledgeable user can easily remove the protection.