Protect worksheet or workbook elements
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 elements in a shared workbook
Protect worksheet elements
- Select the worksheet that you want to protect.
- To unlock any cells or ranges that you want other users to be able to change, do the following:
- Select each cell or range that you want to unlock.
- On the
Hometab, in theCellsgroup, clickFormat, and then clickFormat Cells.
- On the
Protectiontab, clear theLockedcheck box, and then clickOK.
- To hide any formulas that you don't want to be visible, do the following:
- In the worksheet, select the cells that contain the formulas that you want to hide.
- On the
Hometab, in theCellsgroup, clickFormat, and then clickFormat Cells. - On the
Protectiontab, select theHiddencheck box, and then clickOK.
- 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:
- Hold down CTRL and click each graphic object that you want to unlock.
This displays the
Picture ToolsorDrawing Tools, adding theFormattab.Tip You can also use the
Go Tocommand to quickly select all of the graphic objects in a worksheet. On theHometab, in theEditinggroup, clickFind & Select, and then clickGo To. ClickSpecial, and then clickObjects. - On the
Formattab, in theSizegroup, click the Dialog Box Launcher
next to Size. - On the
Propertiestab, clear theLockedcheck box, and if present, clear theLock textcheck 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.
- Hold down CTRL and click each graphic object that you want to unlock.
- On the
Reviewtab, in theChangesgroup, clickProtect Sheet.
- In the
Allow all users of this worksheet tolist, 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 cellsMoving the pointer to cells for which the Lockedcheck box is selected on theProtectiontab of theFormat Cellsdialog box. By default, users are allowed to select locked cells.Select unlocked cellsMoving the pointer to cells for which the Lockedcheck box is cleared on theProtectiontab of theFormat Cellsdialog 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 cellsChanging any of the options in the Format CellsorConditional Formattingdialog 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 ( Hometab,Cellsgroup,Formatbutton).Format rowsUsing any of the row formatting commands, including changing row height or hiding rows ( Hometab,Cellsgroup,Formatbutton).Insert columnsInserting columns. Insert rowsInserting rows. Insert hyperlinksInserting new hyperlinks, even in unlocked cells. Delete columnsDeleting columns. Note If
Delete columnsis protected andInsert columnsis not also protected, a user can insert columns that he or she cannot delete.Delete rowsDeleting rows. Note If
Delete rowsis protected andInsert rowsis not also protected, a user can insert rows that he or she cannot delete.SortUsing any commands to sort data ( Datatab,Sort & Filtergroup).Note Users can't sort ranges that contain locked cells on a protected worksheet, regardless of this setting.
Use AutoFilterUsing 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 reportsFormatting, changing the layout, refreshing, or otherwise modifying PivotTable reports, or creating new reports. Edit objectsDoing 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 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
Select this check box To prevent users from ContentsMaking 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. ObjectsMaking changes to graphic objects-including shapes, text boxes, and controls-unless you unlock the objects before you protect the chart sheet. - In the
Password to unprotect sheetbox, type a password for the sheet, clickOK, 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
- On the
Reviewtab, in theChangesgroup, clickProtect Workbook.
- Under
Protect workbook for, do any of the following:- To protect the structure of a workbook, select the
Structurecheck box. - To keep workbook windows in the same size and position each time the workbook is opened, select the
Windowscheck 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.
- To protect the structure of a workbook, select the
- To prevent other users from removing workbook protection, in the
Password (optional)box, type a password, clickOK, 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
- 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:
- Have all other users save and close the shared workbook to avoid losing their work.
- To keep a copy of the change history information that is lost when you unshare a workbook, do the following:
- On the
Reviewtab, in theChangesgroup, clickTrack Changes, and then clickHighlight Changes.
- In the
Whenlist, selectAll. - Clear the
WhoandWherecheck boxes. - Select the
List changes on a new sheetcheck box, and then clickOK. - Do one or both of the following:
- To print the History worksheet, click
Print
.
- To copy the history to another workbook, select the cells that you want to copy, click
Copy
on the Hometab in theClipboardgroup, switch to another workbook, click where you want to place the copied data, and then clickPaste
on the Hometab in theClipboardgroup.
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.
- To print the History worksheet, click
- On the
- In the shared workbook, on the
Reviewtab, in theChangesgroup, clickShare Workbook. - On the
Editingtab, make sure that you are the only person listed in theWho has this workbook open nowlist. - Clear the
Allow changes by more than one user at the same time. This also allows workbook mergingcheck box.Note If this check box is not available, then you must unprotect the workbook before clearing the check box. Do the following:
- Click
OKto close theShare Workbookdialog box. - On the
Reviewtab, in theChangesgroup, clickUnprotect Shared Workbook. - If you are prompted, enter the password, and then click
OK. - On the
Reviewtab, in theChangesgroup, clickShare Workbook. - On the
Editingtab, clear theAllow changes by more than one user at the same time. This also allows workbook mergingcheck box.
- Click
- 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.
Tip For more information, see Allow cells to be edited in a protected worksheet, Protect worksheet elements, and Protect workbook elements.
- On the
Reviewtab, in theChangesgroup, clickShare Workbook. - Select the
Sharing with track changescheck box. - 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, clickOK, and then retype the password to confirm it. - If prompted, save the workbook.