To prevent a user from accidentally or deliberately changing, moving, or deleting important data, you can protect certain worksheet or workbook elements, with or without a password .

Important Workbook and worksheet element protection should not be confused with workbook-level password security. Element protection cannot protect a workbook from users who have malicious intent.What do you want to do?



Protect worksheet elements

  1. Select the worksheet that you want to protect.
  2. To unlock any cells or ranges that you want other users to be able to change, do the following:
    1. Select each cell or range that you want to unlock.
    2. On the Home tab, in the Cells group, click Format, and then click Format Cells.

      excel ribbon image

    3. On the Protection tab, clear the Locked check box, and then click OK.
  3. To hide any formulas that you don't want to be visible, do the following:
    1. In the worksheet, select the cells that contain the formulas that you want to hide.
    2. On the Home tab, in the Cells group, click Format, and then click Format Cells.
    3. On the Protection tab, select the Hidden check box, and then click OK.
  4. To unlock any graphic objects (such as pictures, clip art, shapes, or Smart Art graphics) that you want users to be able to change, do the following:
    1. Hold down CTRL and click each graphic object that you want to unlock.

      This displays the Picture Tools or Drawing Tools, adding the Format tab.

      Tip You can also use the Go To command to quickly select all of the graphic objects in a worksheet. On the Home tab, in the Editing group, click Find & Select, and then click Go To. Click Special, and then click Objects.

    2. On the Format tab, in the Size group, click the Dialog Box Launcher button image next to Size.
    3. On the Properties tab, clear the Locked check box, and if present, clear the Lock text check box.

      Note You don't need to unlock buttons or controls for users to be able to click and use them. You can unlock embedded charts, text boxes, and other objects created with the drawing tools that you want users to be able to modify.

  5. On the Review tab, in the Changes group, click Protect Sheet.

    excel ribbon image

  6. In the Allow all users of this worksheet to list, select the elements that you want users to be able to change.

    More information about the elements that you can select

    Worksheet elements

    Clear this check box To 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 dialog 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 dialog box. By default, users are allowed to 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 dialog 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 columns Using 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 hyperlinks Inserting new hyperlinks, even in unlocked cells.
    Delete columns Deleting columns.

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

    Delete rows Deleting rows.

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

    Sort Using any commands to sort data (Data tab, Sort & Filter group).

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

    Note Users cannot apply or remove AutoFilters on a protected worksheet, regardless of this setting.

    Use PivotTable reports Formatting, changing the layout, refreshing, or otherwise modifying PivotTable reports, or creating new reports.
    Edit objects Doing the 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 scenarios Viewing 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

    Select this check box To prevent users from
    Contents Making changes to items that are part of the chart, such as data series, axes, and legends. The chart continues to reflect changes made to its source data.
    Objects Making changes to graphic objects-including shapes, text boxes, and controls-unless you unlock the objects before you protect the chart sheet.
  7. In the Password to unprotect sheet box, type a password for the sheet, click OK, and then retype the password to confirm it.

    Note The password is optional. If you don't supply a password, then any user can unprotect the sheet and change the protected elements. Make sure that you choose a password that is easy to remember, because if you lose the password, you cannot gain access to the protected elements on the worksheet.

Protect workbook elements

  1. On the Review tab, in the Changes group, click Protect Workbook.

    excel ribbon image

  2. Under Protect workbook for, do any of the following:
    • To protect the structure of a workbook, select the Structure check box.
    • To keep workbook windows in the same size and position each time the workbook is opened, select the Windows check box.

    More information about the elements that you can select

    Workbook elements

    Select this check box To prevent users from
    Structure
    • Viewing worksheets that you have hidden.
    • Moving, deleting, hiding, or changing the names of worksheets.
    • Inserting new worksheets or chart sheets .

      Note Users will be able to insert an embedded chart in an existing worksheet.

    • Moving or copying worksheets to another workbook.
    • In PivotTable reports, displaying the source data for a cell in the data area, or displaying page field pages on separate worksheets.
    • For scenarios, creating a scenario summary report.
    • In the Analysis ToolPak, using the analysis tools that place results on a new worksheet.
    • Recording new macros.

    Note If you run a macro that includes an operation that can't be performed in a protected workbook, a message appears and the macro stops running.

    Windows
    • Changing the size and position of the windows for the workbook when the workbook is opened.
    • Moving, resizing, or closing the windows.

      Note Users will be able to hide and unhide windows.

  3. To prevent other users from removing workbook protection, in the Password (optional) box, type a password, click OK, and then retype the password to confirm it.

    Note The password is optional. If you don't supply a password, then any user can unprotect the workbook and change the protected elements. Make sure that you choose a password that you can remember, because if you lose the password, you cannot gain access to the protected elements in the workbook.

Protect elements in a shared workbook

  1. If the workbook is already shared, and you want to assign a password to protect the sharing, you must unshare the workbook by doing the following:
    1. Have all other users save and close the shared workbook to avoid losing their work.
    2. To keep a copy of the change history information that is lost when you unshare a workbook, do the following:
      1. On the Review tab, in the Changes group, click Track Changes, and then click Highlight Changes.

        excel ribbon image

      2. In the When list, select All.
      3. Clear the Who and Where check boxes.
      4. Select the List changes on a new sheet check box, and then click OK.
      5. Do one or both of the following:
        • To print the History worksheet, click Print button image.
        • To copy the history to another workbook, select the cells that you want to copy, click Copy button image on the Home tab in the Clipboard group, switch to another workbook, click where you want to place the copied data, and then click Paste button image on the Home tab in the Clipboard group.

        Note You may also want to save or print the current version of the workbook, because this history data might not apply to later versions of the workbook. For example, cell locations, including row numbers, in the copied history may no longer be current.

    3. In the shared workbook, on the Review tab, in the Changes group, click Share Workbook.
    4. On the Editing tab, make sure that you are the only person listed in the Who has this workbook open now list.
    5. Clear the Allow changes by more than one user at the same time. This also allows workbook merging check box.

      Note If this check box is not available, then you must unprotect the workbook before clearing the check box. Do the following:

      1. Click OK to close the Share Workbook dialog box.
      2. On the Review tab, in the Changes group, click Unprotect Shared Workbook.
      3. If you are prompted, enter the password, and then click OK.
      4. On the Review tab, in the Changes group, click Share Workbook.
      5. On the Editing tab, clear the Allow changes by more than one user at the same time. This also allows workbook merging check box.
    6. When you are prompted about the effects on other users, click Yes.
  2. If needed, give specific users access to ranges, protect worksheets, protect workbook elements, and set passwords for viewing and editing.

    Tip For more information, see , , and .

  3. On the Review tab, in the Changes group, click Share Workbook.
  4. Select the Sharing with track changes check box.
  5. To require that other users supply a password to turn off the change history, or to remove the workbook from shared use, in the Password (Optional) box, type a password, click OK, and then retype the password to confirm it.
  6. If prompted, save the workbook.

See also: