Password protect worksheet or workbook elements

To prevent a user from accidentally or deliberately changing, moving, or deleting important data from a worksheet or workbook, you can protect certain worksheet (worksheet: The primary document that you use in Excel to store and work with data. Also called a spreadsheet. A worksheet consists of cells that are organized into columns and rows; a worksheet is always stored in a workbook.) or workbook elements, with or without a password (password: A way to restrict access to a workbook, worksheet, or part of a worksheet. Excel passwords can be up to 255 letters, numbers, spaces, and symbols. You must type uppercase and lowercase letters correctly when you set and enter passwords.). You can remove the protection from a worksheet as needed.

Important    Worksheet and workbook element protection should not be confused with workbook-level password security. Element protection cannot protect a workbook from users who have malicious intent. For an additional layer of security, you should help protect your whole workbook file by using a password. This allows only authorized users to view or modify data in the workbook.

For more information on how to set passwords and for read-only recommendation for a workbook, see the article Protect your document, workbook, or presentation with passwords, permission, and other restrictions.

In this article


Overview of worksheet or workbook element protection

When you share a workbook with other users, you may want to protect data in specific worksheet or workbook elements to help prevent it from being changed. You can also specify a password that users must enter to modify specific, protected worksheet and workbook elements. In addition, you can prevent users from changing the structure of a worksheet.

Protecting worksheet elements

By default, when you protect a worksheet, all the cells on the worksheet are locked, and users cannot make any changes to a locked cell. For example, they cannot insert, modify, delete, or format data in a locked cell. However, you can specify which elements users will be able to change when you protect the worksheet.

Hiding, locking, and protecting workbook and worksheet elements is not intended to help secure or protect any confidential information that you keep in a workbook. It only helps obscure data or formulas that might confuse other users and prevents them from viewing or making changes to that data.

Excel does not encrypt data that is hidden or locked in a workbook. To help keep confidential data confidential, you may want to limit access to workbooks that contain such information by storing them in a location that is available only to authorized users.

Before you protect a worksheet, you can unlock the ranges that you want users to be able to change or enter data in. You can unlock cells for all users or for specific users.

For information on how to unlock cells and ranges in a protected worksheet, see the article Unlock specific areas of a protected worksheet.

Using a password to control access to protected elements

When you protect a worksheet or workbook by locking its elements, adding a password to edit the unlocked elements is optional. In this context, the password is only intended to allow access to certain users while helping to prevent changes by other users. This level of password protection does not guarantee that all sensitive data in your workbook is secure. For an additional layer of security, you should secure a workbook itself with a password to help safeguard it from unauthorized access.

When you protect worksheet or workbook elements by using a password, it is very important that you remember that password. Without it, you cannot unprotect the workbook or worksheet.

Important    

Use strong passwords that combine uppercase and lowercase letters, numbers, and symbols. Weak passwords don't mix these elements. Strong password: Y6dh!et5. Weak password: House27. Passwords should be 8 or more characters in length. A pass phrase that uses 14 or more characters is better. For more information, see Help protect your personal information with strong passwords.

It is critical that you remember your password. If you forget your password, Microsoft cannot retrieve it. Store the passwords that you write down in a secure place away from the information that they help protect.

Protecting the structure and windows of a workbook

You can lock the structure of a workbook, which prevents users from adding or deleting worksheets or from displaying hidden worksheets. You can also prevent users from changing the size or position of worksheet windows. Workbook structure and window protection applies to the whole workbook.

Top of Page Top of Page

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 do not 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 then 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 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 then click OK.

      Note    You do not 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.
    The Changes group on the Review tab
  6. In the Allow all users of this worksheet to list, select the elements that you want users to be able to change.

    ShowMore 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 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 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:

  1. 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.
  2. Making any changes, such as formatting, to an embedded chart. The chart continues to be updated when you change its source data.
  3. 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.
  1. In the Password to unprotect sheet box, type a password for the sheet, click OK, and then retype the password to confirm it.

Top of Page Top of Page

Protect workbook elements

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

The Changes group on the Review tab

  1. Under Protect workbook for, do one or more 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 every time the workbook is opened, select the Windows check box.

ShowMore information about the elements that you can select

Workbook elements

Select this check box To prevent users from
Structure

Note    Users will be able to insert an embedded chart (embedded chart: A chart that is placed on a worksheet rather than on a separate chart sheet. Embedded charts are beneficial when you want to view or print a chart or a PivotChart report with its source data or other information in a worksheet.) 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.
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.

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.

  1. 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 do not 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.

Top of Page Top of Page

Protect elements in a shared workbook

If the workbook is already shared (shared workbook: A workbook set up to allow multiple users on a network to view and make changes at the same time. Each user who saves the workbook sees the changes made by other users.), and you want to assign a password to protect the sharing, you must first unshare the workbook by doing the following:

  1. Have all other users save and close the shared workbook to avoid losing their work.
  2. Open the workbook.
  3. To keep a copy of the change history (change history: In a shared workbook, information that is maintained about changes made in past editing sessions. The information includes the name of the person who made each change, when the change was made, and what data was changed.) 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.
    The Changes group on the Review tab
  2. In the When list, select All.Clear the Who and Where check boxes.
  3. Select the List changes on a new sheet check box, and then click OK.
  4. 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.
  1. In the shared workbook, on the Review tab, in the Changes group, click Protect and Share Workbook.
  2. On the Editing tab, make sure that you are the only person listed in the Who has this workbook open now list.
  3. 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 (password: A way to restrict access to a workbook, worksheet, or part of a worksheet. Excel passwords can be up to 255 letters, numbers, spaces, and symbols. You must type uppercase and lowercase letters correctly when you set and enter passwords.), 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.When you are prompted about the effects on other users, click Yes.

If needed, give specific users access to ranges, protect worksheets, protect workbook elements, and set passwords for viewing and editing. Do the following:

  1. On the Review tab, in the Changes group, click Share Workbook.
  2. Select the Sharing with track changes check box.
  3. 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.If prompted, save the workbook.

Top of Page Top of Page

Remove protection from a worksheet

  1. On the Review tab, in the Changes group, click Unprotect Sheet.

    The Changes group on the Review tab

    Note    The Protect Sheet option changes to Unprotect Sheet when a worksheet is protected.
  2. If prompted, type the password to unprotect the worksheet.

Top of Page Top of Page

 
 
Applies to:
Excel 2010