Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Sorting a protected worksheet

The obvious choice would be to unprotect and reprotect the worksheet

Activesheet.unprotect Password:="ABCD"
Range(Cells(56, 2), Cells(rw, 2)).Select
Selection.Sort Key1:=Range("B56"), Order1:=xlAscending,
Header:=xlGuess, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom
Activesheet.Protect Password:="ABCD"

You can also look at the UserInterfaceOnly property of the Protect method if
you are leary about unprotecting the sheet for the sort.

--
Regards,
Tom Ogilvy


"Vince" wrote in message
...
I am using the following code to sort, and it works fine as long as the

worksheet is not protected. When the worksheet is protected, I get the
error 1004 Sort method of range class failed. I have made sure the cells
that are being sorted are not protected, but I still get the error after I
protect the worksheet. Any help would be appreciated.

Range(Cells(56, 2), Cells(rw, 2)).Select
Selection.Sort Key1:=Range("B56"), Order1:=xlAscending,

Header:=xlGuess, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom

Thank you,
Vince



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
How to allow sorting in a protected worksheet? curtc.[_2_] Excel Discussion (Misc queries) 0 March 23rd 09 05:38 PM
Sorting a Protected Worksheet Shannon Excel Discussion (Misc queries) 1 September 25th 07 01:11 AM
Sorting Protected Worksheet Marge Excel Worksheet Functions 4 April 26th 07 04:56 PM
Sorting on a protected worksheet Sue Excel Discussion (Misc queries) 6 June 12th 05 09:26 AM
Sorting protected worksheet Phyllis Excel Discussion (Misc queries) 3 December 15th 04 11:27 PM


All times are GMT +1. The time now is 11:28 PM.

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

About Us

"It's about Microsoft Excel"