+ Reply to Thread
Results 1 to 2 of 2

Sort in a protected worksheet ?

  1. #1
    Registered User
    Join Date
    11-30-2009
    Location
    Arlington, VA
    MS-Off Ver
    Excel 2003
    Posts
    5

    Question Sort in a protected worksheet ?

    I am working in Excel 2003.

    I want to lock the values and formats of all of the cells on the page, but still be able to sort/use an autofilter.

    To do this I went to Tools --> Protection --> Protect Sheet
    Then I checked "protect worksheet and contents of locked cell" (it won't let me hit ok without checking that)
    Then under "allow all users of this worksheet to:"
    And I selected, "Select locked cells", "Select unlocked cells", "Sort" & "Use AutoFilter"

    From my logic and what I have read online, this should allow me to sort in my worksheet....
    However, when I highlight what I want to sort and select the sort, I get the error message:
    "The cell or chart you are trying to change is protected and therefore read-only. To modify a protected cell or chart, first remove protection using the Unprotect Sheet command."

    What am I doing wrong?

  2. #2
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,721

    Re: Sort in a protected worksheet ?

    Here is what I found, but I don't where this is documented. The "Sort" checkbox in Protect Sheet appears to apply to the "sort" options in the autofilter, rather than the Sort function. If you do not have the Sort checkbox checked, then any attempt to select a sort option from the autofilter menu will just be ignored. Further, even if you allow sorting, you still have to unlock the cells to be sorted.

    This seems to be a confusing design but that's the best I can do in explaining how it works. I cannot figure out how to leave cells locked, yet still allow sorting.

    It would be possible to do this with VBA. The VBA would unprotect the sheet, do the sort, and then re-protect the sheet. You can record a macro to see how it would work. Depends on what kind of filtering/sorting you need to support.
    Jeff
    | | |會 |會 |會 |會 | |:| | |會 |會
    Read the rules
    Use code tags to [code]enclose your code![/code]

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1