Google Groups Home
Help | Sign in
Sort ascending or descending in protected worksheet
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  8 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Roady  
View profile  
 More options Oct 31 2008, 3:13 pm
Newsgroups: microsoft.public.excel.misc
From: Roady <Ro...@discussions.microsoft.com>
Date: Fri, 31 Oct 2008 12:13:01 -0700
Local: Fri, Oct 31 2008 3:13 pm
Subject: Sort ascending or descending in protected worksheet
Hi:
I have an Excel document that is protected. There are macros buttons on the
page which contain un-password protect and then re-protecting at the end to
allow it to perform certain functions for the end-user. However, when I try
to sort ascending or descending, it does not allow it. What is the code for
this?

thank you,
Jen


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Dave Peterson  
View profile  
 More options Oct 31 2008, 3:18 pm
Newsgroups: microsoft.public.excel.misc
From: Dave Peterson <peter...@verizonXSPAM.net>
Date: Fri, 31 Oct 2008 14:18:07 -0500
Local: Fri, Oct 31 2008 3:18 pm
Subject: Re: Sort ascending or descending in protected worksheet
You should be able to record a macro (after you've unprotected the sheet) to
sort either ascending or descending.

Then you'll have the code for that portion.

Roady wrote:

> Hi:
> I have an Excel document that is protected. There are macros buttons on the
> page which contain un-password protect and then re-protecting at the end to
> allow it to perform certain functions for the end-user. However, when I try
> to sort ascending or descending, it does not allow it. What is the code for
> this?

> thank you,
> Jen

--

Dave Peterson


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
John C  
View profile  
 More options Oct 31 2008, 3:19 pm
Newsgroups: microsoft.public.excel.misc
From: John C <johnc@stateofdenial>
Date: Fri, 31 Oct 2008 12:19:01 -0700
Local: Fri, Oct 31 2008 3:19 pm
Subject: RE: Sort ascending or descending in protected worksheet
When protecting a sheet, there is actually a checkbox for SORT. I recorded a
very quick macro, after the statement
ActiveSheet.Protect
you probably have several items here but you would want to include
AllowSorting:=True
--
** John C **


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Roady  
View profile  
 More options Nov 19 2008, 12:10 pm
Newsgroups: microsoft.public.excel.misc
From: Roady <Ro...@discussions.microsoft.com>
Date: Wed, 19 Nov 2008 09:10:01 -0800
Local: Wed, Nov 19 2008 12:10 pm
Subject: Re: Sort ascending or descending in protected worksheet
Hi John and Dave:

I have done both of what you have said, however it gives me the following
error message after being re-protected, "The cell or chart you are trying to
change is protected and therefore read-only. to modify a protected cell or
chart, first remove protection using the Unprotect Sheet command...etc."
Just so I am clear, I want the user to be able to sort and/or filter AFTER
the macro has been run and the sheet is re-protected. In the protect sheet
check box selections, I do select 'allow sort' but somehow it never allows
it. I have the following coding in my macro that should allow that but
somehow does not work:
ActiveSheet.Protect Password:="ABCD", AllowFiltering:=True, AllowSorting:=True

Another weird thing is that even though in the check boxes I select 'Allow
Column Formatting' and 'Allow Row Formatting', it unchecks it after
re-protecting again. HELP! Thanks. :)


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Roady  
View profile  
 More options Nov 19 2008, 12:10 pm
Newsgroups: microsoft.public.excel.misc
From: Roady <Ro...@discussions.microsoft.com>
Date: Wed, 19 Nov 2008 09:10:15 -0800
Local: Wed, Nov 19 2008 12:10 pm
Subject: RE: Sort ascending or descending in protected worksheet
Hi John and Dave:

I have done both of what you have said, however it gives me the following
error message after being re-protected, "The cell or chart you are trying to
change is protected and therefore read-only. to modify a protected cell or
chart, first remove protection using the Unprotect Sheet command...etc."
Just so I am clear, I want the user to be able to sort and/or filter AFTER
the macro has been run and the sheet is re-protected. In the protect sheet
check box selections, I do select 'allow sort' but somehow it never allows
it. I have the following coding in my macro that should allow that but
somehow does not work:
ActiveSheet.Protect Password:="ABCD", AllowFiltering:=True, AllowSorting:=True

Another weird thing is that even though in the check boxes I select 'Allow
Column Formatting' and 'Allow Row Formatting', it unchecks it after
re-protecting again. HELP! Thanks. :)


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Dave Peterson  
View profile  
 More options Nov 19 2008, 1:14 pm
Newsgroups: microsoft.public.excel.misc
From: Dave Peterson <peter...@verizonXSPAM.net>
Date: Wed, 19 Nov 2008 12:14:44 -0600
Local: Wed, Nov 19 2008 1:14 pm
Subject: Re: Sort ascending or descending in protected worksheet
Make sure that all the cells in the range to be sorted are unlocked.

Or just provide a macro that would unprotect the sheet, sort the data, reprotect
the sheet.

--

Dave Peterson


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Roady  
View profile  
 More options Nov 19 2008, 1:29 pm
Newsgroups: microsoft.public.excel.misc
From: Roady <Ro...@discussions.microsoft.com>
Date: Wed, 19 Nov 2008 10:29:18 -0800
Local: Wed, Nov 19 2008 1:29 pm
Subject: Re: Sort ascending or descending in protected worksheet
Hi Dave: unfortunately, I can't make sure all the cells to be sorted are
unlocked because then there is no point in protecting the document. The user
would be able to delete out the contents of the cells which is what I need to
prevent. Does that make sense?

I am not sure what macro I could create. I have about 32 columns with
auto-filters across so would I then need to create a macro for each column? I
don't want to create a macro that will simply unprotect, because that leaves
the data too vulnerable. Ideas?


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Dave Peterson  
View profile  
 More options Nov 19 2008, 1:45 pm
Newsgroups: microsoft.public.excel.misc
From: Dave Peterson <peter...@verizonXSPAM.net>
Date: Wed, 19 Nov 2008 12:45:45 -0600
Local: Wed, Nov 19 2008 1:45 pm
Subject: Re: Sort ascending or descending in protected worksheet
How about an alternative?

Use invisible rectangles over the headers that allows you to sort your data
based on the column of the rectangle that you clicked.

If you want to try that, check out Debra Dalgleish's site:
http://contextures.com/xlSort02.html

You can add a couple of lines to the sort routine--one to unprotect the sheet
and one to reprotect the sheet.

--

Dave Peterson


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2009 Google