#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 120
Default Sort Protected Sheet

I have a huge spreadsheet that contains a list. I don't want people to be
able to modify the data in the spreadsheet but I do want them to have the
ability to sort.

I have protected the spreadsheet and checked sort however they get an error
when they try to sort. Am I missing a step?
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 13
Default Sort Protected Sheet

Hi Erika-
First are you password protecting the sheet or just turning on protection.
If the later, I have some code that will do the sort for the user. Let me
know and I will see what I can do to assist you.

David

"Erika" wrote:

I have a huge spreadsheet that contains a list. I don't want people to be
able to modify the data in the spreadsheet but I do want them to have the
ability to sort.

I have protected the spreadsheet and checked sort however they get an error
when they try to sort. Am I missing a step?

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 22,906
Default Sort Protected Sheet

Sorting on a protected sheet is only possible within an unlocked range on
that sheet.

Best is to use a macro to Unprotect, sort then reprotect.

Placed in a general module..........................

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

your sort code goes here.

ActiveSheet.Protect Password:="justme"
End Sub

If by "list" you mean a DataList you can use alternate code.

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Dim objlist As ListObject
Set objlist = Me.ListObjects(1) 'adjust the (1) if needed
On Error GoTo ws_exit:
Application.EnableEvents = False
If Not Intersect(Target, objlist.Range) Is Nothing Then
Me.Unprotect Password:="justme"
Else
With Me
.Protect Password:="justme"
.EnableSelection = xlNoRestrictions
End With
End If
ws_exit:
Application.EnableEvents = True
End Sub

This is worksheet event code. Right-click the sheet tab and "View Code"

Copy/paste the code into that module. Edit to suit then Alt + q to return
to the Excel window.


Gord Dibben MS Excel MVP

On Wed, 10 Dec 2008 10:40:05 -0800, Erika
wrote:

I have a huge spreadsheet that contains a list. I don't want people to be
able to modify the data in the spreadsheet but I do want them to have the
ability to sort.

I have protected the spreadsheet and checked sort however they get an error
when they try to sort. Am I missing a step?


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Auto filter sort ascending not working while sheet protected TommyB Excel Worksheet Functions 6 March 17th 10 02:51 PM
How to enable the sort function for a protected sheet lkjing Excel Discussion (Misc queries) 1 June 30th 05 01:18 PM
can i sort a protected sheet sindu Excel Discussion (Misc queries) 1 June 17th 05 08:07 PM
Sort on a protected sheet mac Excel Worksheet Functions 1 April 27th 05 06:19 PM
Is it possible to sort a protected worksheet? Phyllis Excel Discussion (Misc queries) 8 January 6th 05 04:45 PM


All times are GMT +1. The time now is 08:08 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"