Advertisements

Lock or unlock specific areas of a protected worksheet

Before entering protected worksheet areas, it is important that you know the outcomes of locking/unlocking those sections. Protecting a worksheet locks all cells to prevent any of them from being modified automatically. To permit some cell editing, while keeping other cells locked, it’s possible to unlock each of the cells. You can lock only precise cells and ranges prior to protecting the worksheet and, optionally, allow certain users to edit only in particular ranges of a protected sheet.

Applies to: Excel for Office 365, Excel 2019, Excel 2016, Excel 2013, Excel 2010, Excel 2007.

Lock only specific cells and ranges in a protected worksheet

Follow these steps:

  1. If the worksheet is protected, do the following:

a. On the Review tab, press Unprotect Sheet (in the Changes group). Choose the Protect Sheet button to Unprotect Sheet when a worksheet is protected.

b. If asked, type the password to unprotect the worksheet.

  1. Click the entire worksheet by selecting the Select All button.
Select All button for entering protected or unprotected
 worksheet areas
  1. On the Home tab, press the Format Cell Font popup launcher. You can also hold down Ctrl+Shift+F or Ctrl+1.
Format Cells dialog box launcher
  1. In the Format Cells popup, in the Protection tab, uncheck the Locked box and then press OK.
Protection tab in the Format Cells dialogue box for entering protected worksheet areas

This opens every cell on the worksheet when you protect the worksheet. As a result, you can decide which cells you preferably want to lock.

  1. On the worksheet, choose only the cells that you aim to lock.
  1. Launch the Format Cells popup window again (Ctrl+Shift+F).
  1. This time, on the Protection tab, tick the Locked box and then press OK.
  1. On the Review tab, select Protect Sheet.
Protect Sheet
  1. In the Allow all users of this worksheet to list, pick the elements based on your preferences as to what you want users to be able to alter.

More information about worksheet elements for entering protected worksheet areas

Clear this checkboxTo prevent users from
Select locked cells

Moving the pointer to cells for which the Locked check box is selected on the Protection tab of the Format Cells dialogue box. By default, users are allowed to select locked cells.
Select unlocked cells
Moving the pointer to cells for which the Locked check box is cleared on the Protection tab of the Format Cells dialogue 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.
Format cells
Changing any of the options in the Format Cells or Conditional Formatting dialogue boxes. If you applied conditional formats before you protected the worksheet, the formatting continues to change when a user enters a value that satisfies a different condition.
Format columnsUsing any of the column formatting commands, including changing column width or hiding columns (Home tab, Cells group, Format button).
Format rows
Using any of the row formatting commands, including changing row height or hiding rows (Home tab, Cells group, Format button).
Insert columns
Inserting columns.
Insert rows
Inserting rows.
Insert hyperlinksInserting new hyperlinks, even in unlocked cells.
Delete columnsDeleting columns.

If Delete columns is protected and Insert columns is not also protected, a user can insert columns that he or she cannot delete.
Delete rowsDeleting rows.
Delete columnsDeleting columns.

If Delete columns is protected and Insert columns is not also protected, a user can insert columns that he or she cannot delete.
Sort
Using any commands to sort data (Data tab, Sort & Filter group).
Users can’t sort ranges that contain locked cells on a protected worksheet, regardless of this setting.
Use AutoFilter
Using the drop-down arrows to change the filter on ranges when AutoFilters are applied.

Users cannot apply or remove AutoFilters on a protected worksheet, regardless of this setting.
Use PivotTable reportsFormatting, changing the layout, refreshing, or otherwise modifying PivotTable reports, or creating new reports.
Edit objectsDoing any of the following:


Making 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.

Making any changes, such as formatting, to an embedded chart. The chart continues to be updated when you change its source data.

Adding or editing comments.
Edit scenariosViewing 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.

Chart sheet elements for entering protected worksheet areas

Select this checkboxTo prevent users from
ContentsEditing items that form a specific element of the chart, such as data series, axes, and legends. The chart continues to reflect changes made to its source data.
ObjectsAltering the state of graphic objects — including shapes, text boxes, and controls — unless you unlock the objects before you protect the chart sheet.
  • Making 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.
  • Making any changes, such as formatting, to an embedded chart. The chart continues to be updated when you change its source data.
  • Adding or editing comments.
  1. In the Password to unprotect sheet box, write a password for the sheet, press OK, and then repeat the password to confirm it.
  • The password is optional. If you decide not to set a password, any user can unprotect the sheet and modify the protected elements.
  • Ensure that you create a memorable password for yourself because if you lose or forget the password, you will permanently forego your access to the protected aspects on the worksheet.

Unlock ranges on a protected worksheet for users to edit

To give specific users permission to edit ranges in a protected worksheet, your computer must be running Microsoft Windows XP or later, and your computer must be in a domain. Instead of using permissions that require a domain, you can also specify a password for a range.

  1. Pick the specific worksheet that you want to protect.
  1. On the Review tab, in the Changes group, press Allow Users to Edit Ranges. This command is only accessible when the worksheet is unprotected.
  1. Do one of the following:
  • For inserting a new editable range, select New.
  • To update a current editable range, choose it in the Ranges unlocked by a password when sheet is protected box, and then select Modify.
  • Erase an editable range by picking it in the Ranges unlocked by a password when sheet is protected box, and then press Delete.
  1. In the Title box, enter the name for the desired range that you want to unlock.
  1. In the Refers to cells box, write an equal sign (=), and then enter the specific reference of the sought range to unlock.

You can also press the Collapse Dialogue button, decide the range in the worksheet, and then select the Collapse Dialogue button again to return to the dialogue box.

  1. For password access, in the Range password box, input a password that grants access to the range.

Setting a password is optional when you intend to use access permissions. Using a password enables you to view user credentials of any authorised person who alters the range.

  1. For access permissions, press Permissions, and then select Add.
  1. In the Enter the object names to select (examples) box, state the names of the users who you want to have editing permissions for the ranges.

To check how user names should be entered, select examples. To confirm that the names are correct, pick Check Names.

  1. Click OK.
  1. To define the type of permission for the user who you chose, in the Permissions box, select or clear the Allow or Deny check boxes, and then click Apply.
  1. Press OK twice.

If asked for a password, enter the password that you created.

  1. In the Allow Users to Edit Ranges dialogue box, select Protect Sheet.
  1. In the Allow all users of this worksheet to list, pick the elements that you want users to be able to change.

More information about worksheet elements for entering protected worksheet areas

Clear this checkboxTo prevent users from
Select locked cells

Moving the pointer to cells for which the Locked check box is selected on the Protection tab of the Format Cells dialogue box. By default, users are allowed to select locked cells.
Select unlocked cells
Moving the pointer to cells for which the Locked check box is cleared on the Protection tab of the Format Cells dialogue 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.
Format cells
Changing any of the options in the Format Cells or Conditional Formatting dialogue boxes. If you applied conditional formats before you protected the worksheet, the formatting continues to change when a user enters a value that satisfies a different condition.
Format columnsUsing any of the column formatting commands, including changing column width or hiding columns (Home tab, Cells group, Format button).
Format rows
Using any of the row formatting commands, including changing row height or hiding rows (Home tab, Cells group, Format button).
Insert columns
Inserting columns.
Insert rows
Inserting rows.
Insert hyperlinksInserting new hyperlinks, even in unlocked cells.
Delete columnsDeleting columns.

If Delete columns is protected and Insert columns is not also protected, a user can insert columns that he or she cannot delete.
Delete rowsDeleting rows.
Delete columnsDeleting columns.

If Delete columns is protected and Insert columns is not also protected, a user can insert columns that he or she cannot delete.
Sort
Using any commands to sort data (Data tab, Sort & Filter group).
Users can’t sort ranges that contain locked cells on a protected worksheet, regardless of this setting.
Use AutoFilter
Using the drop-down arrows to change the filter on ranges when AutoFilters are applied.

Users cannot apply or remove AutoFilters on a protected worksheet, regardless of this setting.
Use PivotTable reportsFormatting, changing the layout, refreshing, or otherwise modifying PivotTable reports, or creating new reports.
Edit objectsDoing any of the following:


Making 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.

Making any changes, such as formatting, to an embedded chart. The chart continues to be updated when you change its source data.

Adding or editing comments.
Edit scenariosViewing 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.

Chart sheet elements for entering protected worksheet areas

Select this checkboxTo prevent users from
ContentsEditing items that form a specific element of the chart, such as data series, axes, and legends. The chart continues to reflect changes made to its source data.
ObjectsAltering the state of graphic objects — including shapes, text boxes, and controls — unless you unlock the objects before you protect the chart sheet.
  1. In the Password to unprotect sheet box, enter a password, select OK, and then re-enter the password to verify it.
  • The password is optional. If you avoid setting a password, then any user can remove the protection of the worksheet and modify the protected elements.
  • Ensure that you choose a memorable password that. Should you lose the password, you will revoke your access to the worksheet’s protected elements.
  • If a cell belongs to more than one range, users who are authorised to edit any of those ranges can edit the cell.
  • In the event of a user trying to edit multiple cells at the same time and is authorised to edit some partial cells, the user will be queried to edit the cells one-by-one.

Need more help?

See these resources for entering protected worksheet areas:

You can always ask an expert in the Excel Tech Community, get support in the Answers community, or suggest a new feature or improvement on Excel User Voice.

See Also

Protect a workbook

Protect a worksheet

Advertisements

Leave a Reply

%d bloggers like this: