Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 26
Default Excel 2003 macro for turning on AtoZ autofiltering on a protected

I am trying to figure out how to allow a user to use the sort ascending and
sort descending options that are displayed when the user clicks the drop down
icon in a autofiltered cell. The other options (all, custom, etc..) work just
fine. I am only having trouble "turning" on the ascending and descending sort
options. Not that the worksheet is protected. Here is an excerpt of my
code.....thanks in advance for the help! Note that AutoFiltering is turned
on....
sub Workbook_Open()
Sheets("WORKLOG").Unprotect
..
..
..
do stuff.....
..
..
ActiveSheet.Protect DrawingObjects:=False, Contents:=True, Scenarios:= _
False, AllowSorting:=True, AllowFiltering:=True,
AllowUsingPivotTables:=True
end sub
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 341
Default Excel 2003 macro for turning on AtoZ autofiltering on a protected

Hi statum

I had a play with this in excel 2003 and it worked fine.

I guess the question you should ask yourself is whether you can make it work
first of all *without* using a macro. Play with it in a very simple blank
workbook. Afterwards, getting the macro right is not such a problem.

When the sheet is protected as you have done it below, excel will let you
use the autofilter. But of course before you protect the sheet you need to
make sure that any cells or rows that you might want to sort are unlocked.
Select all the cells in your data, do Format Cells and unlock them on the
Protection tab.

It is enough for one cell in your data to be locked to mean that you can't
do the sort from the autofilter when the sheet is protected. I reckon this
is what is giving you a headache.

--
If you found this post helpful, please click "Yes".
Allllen


"statum" wrote:

I am trying to figure out how to allow a user to use the sort ascending and
sort descending options that are displayed when the user clicks the drop down
icon in a autofiltered cell. The other options (all, custom, etc..) work just
fine. I am only having trouble "turning" on the ascending and descending sort
options. Not that the worksheet is protected. Here is an excerpt of my
code.....thanks in advance for the help! Note that AutoFiltering is turned
on....
sub Workbook_Open()
Sheets("WORKLOG").Unprotect
.
.
.
do stuff.....
.
.
ActiveSheet.Protect DrawingObjects:=False, Contents:=True, Scenarios:= _
False, AllowSorting:=True, AllowFiltering:=True,
AllowUsingPivotTables:=True
end sub

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 341
Default Excel 2003 macro for turning on AtoZ autofiltering on a protected

Before protecting the sheet, ensure none of the cells in the range you want
to filter are locked. Then it should work.
--
If you found this post helpful, please click "Yes".
Allllen


"statum" wrote:

I am trying to figure out how to allow a user to use the sort ascending and
sort descending options that are displayed when the user clicks the drop down
icon in a autofiltered cell. The other options (all, custom, etc..) work just
fine. I am only having trouble "turning" on the ascending and descending sort
options. Not that the worksheet is protected. Here is an excerpt of my
code.....thanks in advance for the help! Note that AutoFiltering is turned
on....
sub Workbook_Open()
Sheets("WORKLOG").Unprotect
.
.
.
do stuff.....
.
.
ActiveSheet.Protect DrawingObjects:=False, Contents:=True, Scenarios:= _
False, AllowSorting:=True, AllowFiltering:=True,
AllowUsingPivotTables:=True
end sub

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 22,906
Default Excel 2003 macro for turning on AtoZ autofiltering on a protected

Also Autofilter must be enabled before protecting the sheet.


Gord Dibben MS Excel MVP

On Sat, 13 Jun 2009 03:57:01 -0700, Allllen
wrote:

Before protecting the sheet, ensure none of the cells in the range you want
to filter are locked. Then it should work.


  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 26
Default Excel 2003 macro for turning on AtoZ autofiltering on a protec

Thanks for the reply. Can you put your statements in code format so I can see
exactly what you are talking about? I have tried to use
Range("a1:aa10000").locked=false and this did not work. as a matter of fact
it all it did was allow the user to write in the cells. Which I do not want
them to be able to do. I do not understand why the sort ascending and
descending options are not allowed? I have set the allowsorting and
allowfiltering to true when protecting the sheet from my macro, so why can't
the user sort using the Ascending or Descending options in the drop down box
of the autofilter?

"Allllen" wrote:

Before protecting the sheet, ensure none of the cells in the range you want
to filter are locked. Then it should work.
--
If you found this post helpful, please click "Yes".
Allllen


"statum" wrote:

I am trying to figure out how to allow a user to use the sort ascending and
sort descending options that are displayed when the user clicks the drop down
icon in a autofiltered cell. The other options (all, custom, etc..) work just
fine. I am only having trouble "turning" on the ascending and descending sort
options. Not that the worksheet is protected. Here is an excerpt of my
code.....thanks in advance for the help! Note that AutoFiltering is turned
on....
sub Workbook_Open()
Sheets("WORKLOG").Unprotect
.
.
.
do stuff.....
.
.
ActiveSheet.Protect DrawingObjects:=False, Contents:=True, Scenarios:= _
False, AllowSorting:=True, AllowFiltering:=True,
AllowUsingPivotTables:=True
end sub



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 26
Default Excel 2003 macro for turning on AtoZ autofiltering on a protec

Thanks, I did do this in the macro before protecting it....

"Gord Dibben" wrote:

Also Autofilter must be enabled before protecting the sheet.


Gord Dibben MS Excel MVP

On Sat, 13 Jun 2009 03:57:01 -0700, Allllen
wrote:

Before protecting the sheet, ensure none of the cells in the range you want
to filter are locked. Then it should work.



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
Excel 2003 how to stop emails from turning into hyperlinks? KenRetired Excel Discussion (Misc queries) 2 July 14th 08 05:39 AM
Macro will not work in protected Excel 2003 Worksheet LiveUser Excel Programming 1 June 30th 08 04:47 PM
Turning on TrackChanges in Excel 2003 from c#? Michael Howes Excel Programming 0 July 24th 07 07:23 PM
Reg autofiltering using macro in excel with out providing criteria Juno Excel Worksheet Functions 4 May 28th 06 05:48 PM
Turning off all Automatic Formatting in Excel 2003 Adam M Excel Discussion (Misc queries) 0 November 4th 05 01:07 PM


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