Worksheet protection is a two-step process: the first step is to unlock cells that others can edit, and then you can protect the worksheet with or without a password.
Step 1: Unlock any cells that needs to be editable
In your Excel file, select the worksheet tab that you want to protect.
Select the cells that others can edit.
Right-click anywhere in the sheet and select Format Cells (or use Ctrl+1, or Command+1 on the Mac), and then go to the Protection tab and clear Locked.
Step 2: Protect the worksheet
Next, select the actions that users should be allowed to take on the sheet, such as insert or delete columns or rows, edit objects, sort, or use AutoFilter, to name a few. Additionally, you can also specify a password to lock your worksheet. A password prevents other people from removing the worksheet protection—it needs to be entered to unprotect the sheet.
Given below are the steps to protect your sheet.
On the Review tab, click Protect Sheet.
In the Allow all users of this worksheet to list, select the elements you want people to be able to change.
Allows users to
Select locked cells
Move the pointer to cells for which the Locked box is checked on the Protection tab of the Format Cells dialog box. By default, users are allowed to select locked cells.
Select unlocked cells
Move the pointer to cells for which the Locked box is unchecked on the Protection tab of the Format Cells dialog box. By default, users can select unlocked cells, and they can press the TAB key to move between the unlocked cells on a protected worksheet.
Change any of the options in the Format Cells or Conditional Formatting dialog boxes. If you applied conditional formatting before you protected the worksheet, the formatting continues to change when a user enters a value that satisfies a different condition.
Note: Paste now correctly honors the Format cells option. In older versions of Excel, paste always pasted with formatting regardless of the Protection options.
Use any of the column formatting commands, including changing column width or hiding columns (Home tab, Cells group, Format button).
Use any of the row formatting commands, including changing row height or hiding rows (Home tab, Cells group, Format button).
Insert new hyperlinks, even in unlocked cells.
Use any commands to sort data (Data tab, Sort & Filter group).
Use the drop-down arrows to change the filter on ranges when AutoFilters are applied.
Use PivotTable reports
Format, change the layout, refresh, or otherwise modify PivotTable reports, or create new reports.
Doing any of the following:
Make changes to graphic objects including maps, embedded charts, shapes, text boxes, and controls that you did not unlock before you protected the worksheet. For example, if a worksheet has a button that runs a macro, you can click the button to run the macro, but you cannot delete the button.
Make any changes, such as formatting, to an embedded chart. The chart continues to be updated when you change its source data.
Add or edit notes.
View scenarios that you have hidden, making changes to scenarios that you have prevented changes to, and deleting these scenarios. Users can change the values in the changing cells, if the cells are not protected, and add new scenarios.
Optionally, enter a password in the Password to unprotect sheet box and click OK. Reenter the password in the Confirm Password dialog box and click OK.