Please Note: This article is written for users of the following Microsoft Excel versions: 2007, 2010, 2013, 2016, 2019, and Excel in Microsoft 365. If you are using an earlier version (Excel 2003 or earlier), this tip may not work for you. For a version of this tip written specifically for earlier versions of Excel, click here: Sorting Data on Protected Worksheets.

Sorting Data on Protected Worksheets

Written by Allen Wyatt (last updated October 10, 2020)
This tip applies to Excel 2007, 2010, 2013, 2016, 2019, and Excel in Microsoft 365


3

When you protect a worksheet, Excel stops users from performing a wide variety of tasks on the data in the worksheet. One of the things that the user can no longer do is to sort data. What if you want the user to be able to sort data, but still have the sheet protected?

The answer is quite easy: Excel allows you to specify what users can and cannot do with a protected worksheet. When you display the Review tab of the ribbon and click Protect Sheet in the Protect group (Changes group in earlier versions of Excel), Excel displays the Protect Sheet dialog box. At the bottom of the dialog box is a long list of check boxes. All you need to do is select what the user should be able to do with the worksheet. One of the options (you need to scroll down a bit) is Sort. If you select this option, then users can sort protected data.

There is a big caveat to keep in mind: All of the cells that will be involved in the sorting (or potentially involved in the sorting) must be unlocked. This includes any column headings for the data that may be sorted.

Before locking the worksheet, select all the cells that you want people to be able to sort. (A great way to do this is to select one of the cells then press Shift+Ctrl+8. The selected region is what Excel thinks should be sorted when a sort is done.) With those cells still selected, display the Protection tab of the Format Cells dialog box and clear the Locked check box. Now protect your worksheet and make sure you allow for sorting in the protection specifications.

If you fail to unprotect all the cells that may be involved in the sorting (even a single cell), then Excel won't allow sorting the data on the protected worksheet, even if you've instructed it to allow sorting.

Note:

If you would like to know how to use the macros described on this page (or on any other page on the ExcelTips sites), I've prepared a special page that includes helpful information. Click here to open that special page in a new browser tab.

ExcelTips is your source for cost-effective Microsoft Excel training. This tip (137) applies to Microsoft Excel 2007, 2010, 2013, 2016, 2019, and Excel in Microsoft 365. You can find a version of this tip for the older menu interface of Excel here: Sorting Data on Protected Worksheets.

Author Bio

Allen Wyatt

With more than 50 non-fiction books and numerous magazine articles to his credit, Allen Wyatt is an internationally recognized author. He is president of Sharon Parq Associates, a computer and publishing services company. ...

MORE FROM ALLEN

Using Copy and Paste for Formatting

Want to copy formatting from one cell and paste it into another cell? It's easy to do if you use the Paste Special ...

Discover More

Referencing Worksheet Tabs

Ever want to use the name of a worksheet tab within a cell? Here's how you can access that information using the CELL ...

Discover More

Turning Off Capital Corrections

Tired of having Excel second-guess you when you type a word that starts with two capital letters? You can turn off this ...

Discover More

Professional Development Guidance! Four world-class developers offer start-to-finish guidance for building powerful, robust, and secure applications with Excel. The authors show how to consistently make the right design decisions and make the most of Excel's powerful features. Check out Professional Excel Development today!

More ExcelTips (ribbon)

Sorting by the Last Digits in Variable Length Data

Excel is great at sorting information in a worksheet. Sometimes it can be a bit confusing as to how to set up the sort ...

Discover More

Controlling Sorting Order

When you sort information in a worksheet, you have control over the order in which that information is sorted. Here's a ...

Discover More

Non-standard Sorting

Information in a cell can be entered using line feeds, which results in multiple lines of data in the same cell. If you ...

Discover More
Subscribe

FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."

View most recent newsletter.

Comments

If you would like to add an image to your comment (not an avatar, but an image to help in making the point of your comment), include the characters [{fig}] (all 7 characters, in the sequence shown) in your comment text. You’ll be prompted to upload your image when you submit the comment. Maximum image size is 6Mpixels. Images larger than 600px wide or 1000px tall will be reduced. Up to three images may be included in a comment. All images are subject to review. Commenting privileges may be curtailed if inappropriate images are posted.

What is two less than 9?

2021-02-25 20:43:05

Kelly A

what good is protecting a sheet if you have to unlock cells in order to allow sorting? i have an input table, some columns locked and some not so user can enter info. i would like to allow them to sort the table but i still need the cells protected!


2020-10-11 10:31:38

David Gray

This tip explains something that has puzzled me since I began using locked sheets to protect formulas against accidental changes.

From my point of view, this limitation effectively renders sorting unusable on protected worksheets.


2020-10-10 23:00:12

Col Delane

This has always been a pretty useless feature, for it assumes that the entire contents of the range to be sorted (often a "database" of some kind) consists of input data, when often spreadsheet builders create databases that are a mix of values and formula, the latter of which they wish to Lock so the client users cannot change them.
The workaround is to write a macro that unprotects the sheet (so the Lock status of any cell is temporarily render inactive), then sorts the range, then reprotects the sheet.


This Site

Got a version of Excel that uses the ribbon interface (Excel 2007 or later)? This site is for you! If you use an earlier version of Excel, visit our ExcelTips site focusing on the menu interface.

Newest Tips
Subscribe

FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."

(Your e-mail address is not shared with anyone, ever.)

View the most recent newsletter.