Question about sorting in protected worksheet

G

Guest

I have created a spreadsheet to be used by others in which they will input
their monthly data. So many of you have helped me put this thing together--I
am extremely grateful to you all. My hopefully last question is regarding
protection. I have protected all of the worksheets, as the last time we did
this sort of spreadsheet, novice users ended up deleting and changing all of
the formulas and links. However, I realize that you cannot use the 'sort'
function while the worksheet is protected. They will need to sort their
data. Is there a way to protect a worksheet while also keeping the sort
function?

Thanks for any insight!
 
C

Cesar Zapata

If you are using excel 2003 and may be xp... when you protect you have
the option to allow sorting. If you have lesser versions then I think
you gonna have to go VBA.
 
G

Gord Dibben

Cesar

Just a point here..

You can only sort on areas that have been unlocked prior to protetimg the
worksheet.

2002 and 2003.


Gord Dibben Excel MVP
 
G

Gord Dibben

SJC

Sub sortprotected()
ActiveSheet.Unprotect Password:="justme"

'your sort code which you get from the macro recorder

ActiveSheet.Protect Password:="justme", DrawingObjects:=True, _
Contents:=True, Scenarios:=True
End Sub

Note: for users not to have access to the password, you must protect the VBA
Project, which could be cracked by a determined user.


Gord Dibben Excel MVP
 
G

Guest

Yes, that will do it--thank you so much!!

Gord Dibben said:
SJC

Sub sortprotected()
ActiveSheet.Unprotect Password:="justme"

'your sort code which you get from the macro recorder

ActiveSheet.Protect Password:="justme", DrawingObjects:=True, _
Contents:=True, Scenarios:=True
End Sub

Note: for users not to have access to the password, you must protect the VBA
Project, which could be cracked by a determined user.


Gord Dibben Excel MVP
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top