HELP sorting a protected worksheet


Posted by Brian Bleck on February 09, 2001 12:36 PM

I have spreadsheets that I am sending out to vendors. For this reason I want the data contained in the worksheet to be protected, however I also want to give the vendor the ability to sort the spreadsheet. How do I protect the spreadsheet AND allow sorting? Is this possible? Thanks for any advice someone may have.



Posted by Dave Hawley on February 09, 2001 8:47 PM

Hi Brian

It is possible but you will need VBA.

Push Alt+F11, go to Insert>Module and paste in this code:

Sub SortList()
On Error GoTo NoList
ActiveSheet.Unprotect Password:="secret"
Application.Dialogs(xlDialogSort).Show
ActiveSheet.Protect Password:="secret"
Exit Sub
NoList:
MsgBox "No list found, please select any cell within your list"
ActiveSheet.Protect Password:="secret"
End Sub


Push Alt+Q to return to Excel.

Go to Tools>Macro>Macros, select "SortList" click options and assign a shortcut key.


Dave


  • OzGrid Business Applications