+ Reply to Thread
Results 1 to 7 of 7

Can a sheet with locked data be sorted without setting 'Allow users to edit ranges'?

  1. #1
    Forum Contributor
    Join Date
    11-28-2013
    Location
    Here
    MS-Off Ver
    Excel 2010
    Posts
    119

    Can a sheet with locked data be sorted without setting 'Allow users to edit ranges'?

    Hello,

    I have a worksheet of data that has a header row and the filter button is applied to the header row allowing to filter and sort data by column.

    Some rows of data are locked while others are not or partial rows of data are 'locked'. The worksheet is protected.

    With these settings, the filters work but you are not able to sort because of the locked cells.

    I have found that if you set 'Allow users to edit ranges' located under the 'Review' tab to include the entire sheet of data, you are then able to sort the data even if the sheet is locked. But then you run into other problems, namely if you allow users to select locked cells, they can alter/delete data since an editable range has been set.

    So my question is, can a sheet with locked data be sorted without setting an editable range via the 'Allow users to edit ranges' under the 'Review' tab?

    Thanks for any help.

    TV

  2. #2
    Forum Guru HaHoBe's Avatar
    Join Date
    02-19-2005
    Location
    Hamburg, Germany
    MS-Off Ver
    work: 2016 on Win10 (notebook), private: 2019 on Win10 (desktop), 2019 on Win11 (notebook)
    Posts
    8,197

    Re: Can a sheet with locked data be sorted without setting 'Allow users to edit ranges'?

    Hi, tv69,

    since this thread is posted under VBA: why not unprotect the sheet in code, sort, protect via code? Or use the parameter UserInterfaceOnly:=True and protect the sheet on opening or activating (this is a volatile setting which won´t be stored with the workbook).

    Ciao,
    Holger
    Use Code-Tags for showing your code: [code] Your Code here [/code]
    Please mark your question Solved if there has been offered a solution that works fine for you

  3. #3
    Forum Contributor
    Join Date
    11-28-2013
    Location
    Here
    MS-Off Ver
    Excel 2010
    Posts
    119

    Re: Can a sheet with locked data be sorted without setting 'Allow users to edit ranges'?

    Holger

    I had thought of that approach a while back but I was not able to find a way to detect via VBA the action of sort/filter via the filter button. As for UserInterfaceOnly, I tried that one out for other actions in my workbook and it proved to be very unreliable so I resorted to unprotect, make change, protect for all actions to change locked cells.

    TV

  4. #4
    Forum Guru HaHoBe's Avatar
    Join Date
    02-19-2005
    Location
    Hamburg, Germany
    MS-Off Ver
    work: 2016 on Win10 (notebook), private: 2019 on Win10 (desktop), 2019 on Win11 (notebook)
    Posts
    8,197

    Re: Can a sheet with locked data be sorted without setting 'Allow users to edit ranges'?

    Hi, TV,

    what about adding an own routine for that sorting (maybe ask for the column and the criteria via Combo-/Listboxes) and getting started via button?

    Ciuao,
    Holger

  5. #5
    Forum Contributor
    Join Date
    11-28-2013
    Location
    Here
    MS-Off Ver
    Excel 2010
    Posts
    119

    Re: Can a sheet with locked data be sorted without setting 'Allow users to edit ranges'?

    Hi Holger, I can certainly take that approach and that may be my only choice if there is no other way to avoid using 'Allow users to edit ranges', making locked data susceptible to changes. I just will have to think of a way to allow users to sort on more than one column though, perhaps an iterative process asking for column order.

    Cheers,

    TV

  6. #6
    Forum Guru HaHoBe's Avatar
    Join Date
    02-19-2005
    Location
    Hamburg, Germany
    MS-Off Ver
    work: 2016 on Win10 (notebook), private: 2019 on Win10 (desktop), 2019 on Win11 (notebook)
    Posts
    8,197

    Re: Can a sheet with locked data be sorted without setting 'Allow users to edit ranges'?

    Hi, TV,

    as I do not know very much about your project: could the use of the Advanced Filter instead of the Autofilter solve be an alternative if criteria as well as destination range are located on another sheet as the data range?

    Ciao,
    Holger

  7. #7
    Forum Contributor
    Join Date
    11-28-2013
    Location
    Here
    MS-Off Ver
    Excel 2010
    Posts
    119

    Re: Can a sheet with locked data be sorted without setting 'Allow users to edit ranges'?

    Holger, thanks for the heads up on the Advanced Filter. I never knew about it until now, however my data is all on one sheet so it is not a good fit.

    Cheers,

    TV

+ 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: 0
    Last Post: 04-07-2014, 10:01 AM
  2. Allow users to edit ranges
    By isameer in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 01-02-2014, 06:17 AM
  3. Allow Users to Edit Ranges Using Users from a Network Location
    By Tayque_J_Holmes in forum Excel General
    Replies: 0
    Last Post: 10-24-2013, 06:34 AM
  4. [SOLVED] Allow Users To Edit Ranges (330 Of them???)!
    By Margate in forum Excel General
    Replies: 3
    Last Post: 02-13-2013, 12:26 AM
  5. Replies: 1
    Last Post: 05-13-2011, 11:25 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