Solved

Sorting columns in a protected worksheet

Posted on 2013-12-26
2
282 Views
Last Modified: 2013-12-26
I have a worksheet where all cells are protected, however, I would like to allow users to sort.  I have selected the options for allowing 'sorting' and 'auto filer' when setting the password, however, I believe I must also have some kind of code in there as well.

I found the below code somewhere else which I am not sure will work, because I currently have code in there to allow users to group/ungroup on another sheet in the workbook.  If the below code is correct, how would I incorporate this into my existing code as shown on the sample attached?  If the code is incorrect, what would be the correct code and how should it be incorporating into the existing code?  Thanks!

Private Sub Workbook_Open()
For Each ws In ActiveWorkbook.Worksheets


ws.Protect Password:="", AllowSorting:=True

Next
End Sub
sample.xlsm
0
Comment
Question by:daisypetals313
2 Comments
 
LVL 23

Accepted Solution

by:
Michael74 earned 500 total points
ID: 39740967
The problem is bit more complicated than the answer you proposed.

Here is a really good article which includes 2 different solutions to the issue

http://blog.softartisans.com/2013/10/01/kb-sorting-locked-cells-in-protected-worksheets/

Michael
0
 

Author Closing Comment

by:daisypetals313
ID: 39740980
It worked!  I used the Scenario 1 option from the article.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Introduction This Article is a follow-up to my Mappit! Addin Article (http://www.experts-exchange.com/A_2613.html), it was inspired by an email posting I made to EUSPRIG (http://www.eusprig.org/index.htm), I will briefly cover: 1) An overvie…
This article descibes how to create a connection between Excel and SAP and how to move data from Excel to SAP or the other way around.
The viewer will learn how to use a discrete random variable to simulate the return on an investment over a period of years, create a Monte Carlo simulation using the discrete random variable, and create a graph to represent the possible returns over…
This Micro Tutorial demonstrate the bugs in Microsoft Excel for Mac with Pivot Charts.

863 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

25 Experts available now in Live!

Get 1:1 Help Now