Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / New Users / July 2006

Tip: Looking for answers? Try searching our database.

How do I sort a proctected worksheet

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Audrey - 18 Jul 2006 18:48 GMT
Chip Pearson - 18 Jul 2006 18:49 GMT
Unprotect it.

Signature

Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com

Audrey - 27 Jul 2006 17:38 GMT
That is a given, but I have columns that I don't want sorted.  

I have locked those columns in hopes they would not sort and the others would.

Any suggestions?

Thanks for the help.

> Unprotect it.
Dave Peterson - 27 Jul 2006 18:13 GMT
Be specific about the range to sort--exclude the columns that should not be
sorted from the range to be sorted.

The range to sort must be contiguous, though.

dim wks as worksheet
dim rng as range
set wks = worksheets("Protected")
with wks
 .unprotect password:="Hi"
 set rng = .range("d3:g" & .cells(.rows.count,"D").end(xlup).row)
 
 with rng
     .sort key1:=.columns(3), order1:=xlascending, header:=true
 end with
 .protect password:="Hi"
end with

===
Untested and uncompiled--watch for typos.

I sorted D3:G (lastrow in column D).  and avoided all the other cells.


> That is a given, but I have columns that I don't want sorted.
>
[quoted text clipped - 12 lines]
> > Pearson Software Consulting, LLC
> > www.cpearson.com

Signature

Dave Peterson


Rate this thread:






 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.