+ Reply to Thread
Results 1 to 6 of 6

Unable to sort on a protected worksheet

  1. #1
    Registered User
    Join Date
    10-22-2015
    Location
    Melbourne, Australia
    MS-Off Ver
    Excel 2013
    Posts
    4

    Angry Unable to sort on a protected worksheet

    My excel document is linked together using macro buttons which when pressed link to a series of protected worksheets.

    The issue I am having occurs when I try to sort the data in the worksheet

    To achieve a sort on a protected worksheet I followed the following procedure:-
    1. Removed the protection by typing in the password
    2. Highlighted the cells of the worksheet containing the data, pressed right click, format cells, protection, unlocked cells
    3. Re-typed the worksheet password to protect it (after selecting sort and filter from the list of options)

    At this point everything works as you would expect ie I can carry out sorts and also filter the data without any problem.

    My dilemma is when I navigate away from this worksheet. For some reason when I do this and then return to the original worksheet the filter and sort buttons no longer work. It is incredibly frustrating.

    Any help would be greatly appreciated

  2. #2
    Forum Expert gmr4evr1's Avatar
    Join Date
    11-24-2014
    Location
    Texas
    MS-Off Ver
    Office 2010 and 2007
    Posts
    3,448

    Re: Unable to sort on a protected worksheet

    Try this under the sub title in your code
    Please Login or Register  to view this content.
    1N73LL1G3NC3 15 7H3 4B1L17Y 70 4D4P7 70 CH4NG3 - 573PH3N H4WK1NG
    You don't have to add Rep if I have helped you out (but it would be nice), but please mark the thread as SOLVED if your issue is resolved.

    Tom

  3. #3
    Registered User
    Join Date
    10-22-2015
    Location
    Melbourne, Australia
    MS-Off Ver
    Excel 2013
    Posts
    4

    Re: Unable to sort on a protected worksheet

    Hi Tom

    Unfortunately that didn't reslove the problem. Have I entered the code you sent me in the correct place? (see below)

    Sub MOR__152()
    ActiveSheet.Protect userinterfaceonly:=True, Password:="1", AllowSorting:=True, AllowFiltering:=True, AllowFormattingColumns:=True
    ' MOR__152 Macro
    '
    Sheets("Year 7").Select
    ActiveSheet.Unprotect Password:="Fredflinstone_7"
    ActiveSheet.ShowAllData
    ActiveSheet.Range("$B$4:$CC$1542").AutoFilter Field:=5, Criteria1:="7HG15A"
    ActiveSheet.Protect Password:="Fredflinstone_7"

    End Sub

    Best Wishes

    Darren

  4. #4
    Forum Expert gmr4evr1's Avatar
    Join Date
    11-24-2014
    Location
    Texas
    MS-Off Ver
    Office 2010 and 2007
    Posts
    3,448

    Re: Unable to sort on a protected worksheet

    Yes, that is where I said to place that line of code. But, since the rest of the code protects and unprotects that sheet, I'm not sure if it will work. Then again, maybe it should be placed after the
    Sheets("Year 7").Select line. I'm thinking that placing that line of code where I said to might be creating the problem since it is trying to run before the Year 7 sheet is selected....if that makes sense.

  5. #5
    Registered User
    Join Date
    10-22-2015
    Location
    Melbourne, Australia
    MS-Off Ver
    Excel 2013
    Posts
    4

    Re: Unable to sort on a protected worksheet

    G'day Tom

    Thanks for your help mate, the code you sent me was spot on. The reason why it hadn't worked was I left the password as ="1". As soon as a changed this to the password of the worksheet it worked.

    Much appreciated

    Darren

    How do I confirm that you have solved the problem for me? (I'm new to this)

  6. #6
    Forum Expert gmr4evr1's Avatar
    Join Date
    11-24-2014
    Location
    Texas
    MS-Off Ver
    Office 2010 and 2007
    Posts
    3,448

    Re: Unable to sort on a protected worksheet

    You are welcome, glad it worked. To mark this as solved, I believe you click Thread Tools at the top of your original post and select SOLVED.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 3
    Last Post: 06-20-2014, 04:50 PM
  2. Replies: 5
    Last Post: 06-20-2014, 02:12 PM
  3. Unable to sort with protected sheet
    By milt2010 in forum Excel - New Users/Basics
    Replies: 5
    Last Post: 12-30-2013, 02:45 PM
  4. Sort in a protected worksheet ?
    By dunCar in forum Excel General
    Replies: 1
    Last Post: 03-24-2010, 02:25 PM
  5. sort a protected worksheet
    By shrvjack in forum Excel General
    Replies: 1
    Last Post: 02-13-2008, 03:13 PM
  6. [SOLVED] How do I sort a protected worksheet?
    By Audrey in forum Excel General
    Replies: 0
    Last Post: 07-18-2006, 03:35 PM
  7. [SOLVED] How to Sort Protected Worksheet
    By mr.lord in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 05-28-2005, 02:48 AM

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