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

Hello,
I have an MS Excel worksheet (Excel 2002), for which I have password
protectection enabled.

There are several columns which the users can enter data, they would also
like to sort the data (both asc. & desc.), but as you know, sorting functions
are disabled when protection is on.

I have tried this code, to no avail:
----------------------------------------------------------------------------------------------
Sub SortSheet()

ActiveSheet.Unprotect Password:="cfo2006"
Range("A14:Q14").Sort Key1:=Range("C14"), Order1:=xlDescending, Header:= _
xlGuess, OrderCustom:=1, MatchCase:=False,
Orientation:=xlTopToBottom, _
DataOption1:=xlSortNormal
ActiveSheet.Protect Password:="cfo2006", DrawingObjects:=True,
Contents:=True, Scenarios:=True
End Sub
---------------------------------------------------------------------------------------------
Can you offer any ideas to help me with this problem??
--
Thanks in advance for your assistance!
Coach Tony
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 156
Default Sorting Rows on a password protected worksheet

It looks like your range is only one row and you are sorting top to
bottom so when it sorts there is only one variable in the column to
sort, try setting the range to cover all the data and then run the
code.

Sandy

CoachTony wrote:
Hello,
I have an MS Excel worksheet (Excel 2002), for which I have password
protectection enabled.

There are several columns which the users can enter data, they would also
like to sort the data (both asc. & desc.), but as you know, sorting functions
are disabled when protection is on.

I have tried this code, to no avail:
----------------------------------------------------------------------------------------------
Sub SortSheet()

ActiveSheet.Unprotect Password:="cfo2006"
Range("A14:Q14").Sort Key1:=Range("C14"), Order1:=xlDescending, Header:= _
xlGuess, OrderCustom:=1, MatchCase:=False,
Orientation:=xlTopToBottom, _
DataOption1:=xlSortNormal
ActiveSheet.Protect Password:="cfo2006", DrawingObjects:=True,
Contents:=True, Scenarios:=True
End Sub
---------------------------------------------------------------------------------------------
Can you offer any ideas to help me with this problem??
--
Thanks in advance for your assistance!
Coach Tony


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 156
Default Sorting Rows on a password protected worksheet

If you are trying to sort by row change the orientation to
xlLeftToRight. If you are sorting by columns then you need to adjust
your range , you only have one row of data in each column to sort.

Sandy

CoachTony wrote:
Hello,
I have an MS Excel worksheet (Excel 2002), for which I have password
protectection enabled.

There are several columns which the users can enter data, they would also
like to sort the data (both asc. & desc.), but as you know, sorting functions
are disabled when protection is on.

I have tried this code, to no avail:
----------------------------------------------------------------------------------------------
Sub SortSheet()

ActiveSheet.Unprotect Password:="cfo2006"
Range("A14:Q14").Sort Key1:=Range("C14"), Order1:=xlDescending, Header:= _
xlGuess, OrderCustom:=1, MatchCase:=False,
Orientation:=xlTopToBottom, _
DataOption1:=xlSortNormal
ActiveSheet.Protect Password:="cfo2006", DrawingObjects:=True,
Contents:=True, Scenarios:=True
End Sub
---------------------------------------------------------------------------------------------
Can you offer any ideas to help me with this problem??
--
Thanks in advance for your assistance!
Coach Tony


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Sorting Rows on a password protected worksheet

Sandy, YOU ARE AWESOME!

Works like a charm, when you set it up correctly -)

Thanks very much for your quick response, I appreciate it!
--
Coach Tony


"Sandy" wrote:

If you are trying to sort by row change the orientation to
xlLeftToRight. If you are sorting by columns then you need to adjust
your range , you only have one row of data in each column to sort.

Sandy

CoachTony wrote:
Hello,
I have an MS Excel worksheet (Excel 2002), for which I have password
protectection enabled.

There are several columns which the users can enter data, they would also
like to sort the data (both asc. & desc.), but as you know, sorting functions
are disabled when protection is on.

I have tried this code, to no avail:
----------------------------------------------------------------------------------------------
Sub SortSheet()

ActiveSheet.Unprotect Password:="cfo2006"
Range("A14:Q14").Sort Key1:=Range("C14"), Order1:=xlDescending, Header:= _
xlGuess, OrderCustom:=1, MatchCase:=False,
Orientation:=xlTopToBottom, _
DataOption1:=xlSortNormal
ActiveSheet.Protect Password:="cfo2006", DrawingObjects:=True,
Contents:=True, Scenarios:=True
End Sub
---------------------------------------------------------------------------------------------
Can you offer any ideas to help me with this problem??
--
Thanks in advance for your assistance!
Coach Tony



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 retrive password protected worksheet but forgot password? Laurie Excel Worksheet Functions 1 November 19th 09 09:42 PM
password protected worksheet billy Excel Discussion (Misc queries) 7 August 26th 08 04:38 PM
Password protected worksheet GARY Excel Discussion (Misc queries) 2 September 18th 07 07:24 AM
Exel Worksheet Protected With A Password Best Buy Excel Worksheet Functions 1 September 20th 05 03:55 AM
how do i unhide password protected rows? RhondaJ Excel Discussion (Misc queries) 2 May 4th 05 12:02 AM


All times are GMT +1. The time now is 03:21 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"