Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27
Default Use AutoFilter

I have a protected sheet and would like the on Open event to enable the use
of Autofilters however, my code produces the following resullt

......
For Each ws In Worksheets
ws.AutoFilterMode = True
Next

Run-Time Error 1004, Application defined or object defined error

Thanks
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,593
Default Use AutoFilter

From help

This property returns True if the drop-down arrows are currently displayed.
You can set this property to False to remove the arrows, but you cannot set
it to True. Use the AutoFilter method to filter a list and display the
drop-down arrows.


--
---
HTH

Bob


(there's no email, no snail mail, but somewhere should be gmail in my addy)



"Rafi" wrote in message
...
I have a protected sheet and would like the on Open event to enable the use
of Autofilters however, my code produces the following resullt

.....
For Each ws In Worksheets
ws.AutoFilterMode = True
Next

Run-Time Error 1004, Application defined or object defined error

Thanks



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27
Default Use AutoFilter

Bob,

Thanks for your response; I think I need to better explain the situation. I
have a protected excel file posted to a SharePoint server and I want to make
sure that the users will be able to use the autofilters without having to
unprotect the file. So my idea was to write a macro that will execute on
openning of te file to enable the use of AutoFilters onn a protected sheeet.

Thanks again


"Bob Phillips" wrote:

From help

This property returns True if the drop-down arrows are currently displayed.
You can set this property to False to remove the arrows, but you cannot set
it to True. Use the AutoFilter method to filter a list and display the
drop-down arrows.


--
---
HTH

Bob


(there's no email, no snail mail, but somewhere should be gmail in my addy)



"Rafi" wrote in message
...
I have a protected sheet and would like the on Open event to enable the use
of Autofilters however, my code produces the following resullt

.....
For Each ws In Worksheets
ws.AutoFilterMode = True
Next

Run-Time Error 1004, Application defined or object defined error

Thanks




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 22,906
Default Use AutoFilter

You cannot change the sheet protection attributes without unprotecting the sheet
first.

To use Autofilter on a protected sheet you must have Autofilter set up prior to
protecting the sheet.

Your open code must unprotect the sheet, select a range then
DataFilterAutofilter then re-protect with the "use autofilter" enabled.

Sub Workbook_Open()
Sheets("Sheet1").Select
With ActiveSheet
.Unprotect Password:="justme"
.Range("A1:F1").Select
Selection.AutoFilter
.Protect Password:="justme", DrawingObjects:=True, _
Contents:=True, Scenarios:=True _
, AllowFiltering:=True
End With
End Sub


Gord Dibben MS Excel MVP


On Mon, 3 Mar 2008 16:37:01 -0800, Rafi wrote:

Thanks for your response; I think I need to better explain the situation. I
have a protected excel file posted to a SharePoint server and I want to make
sure that the users will be able to use the autofilters without having to
unprotect the file. So my idea was to write a macro that will execute on
openning of te file to enable the use of AutoFilters onn a protected sheeet.


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 2007 autofilter change to 2003 autofilter functionality? jonnybrovo815 Excel Discussion (Misc queries) 1 April 19th 10 10:05 PM
2007 excel autofilter back to 2003 autofilter? jonnybrovo815 Excel Discussion (Misc queries) 3 April 19th 10 08:11 PM
2007 excel autofilter change back to 2003 autofilter? jonnybrovo815 Excel Discussion (Misc queries) 1 April 19th 10 05:53 PM
2007 Autofilter worse than 2003 Autofilter jsky Excel Discussion (Misc queries) 9 October 31st 07 12:14 AM
How to Sort within AutoFilter with Protection on (and AutoFilter . giblon Excel Discussion (Misc queries) 1 February 16th 06 12:23 PM


All times are GMT +1. The time now is 12:20 PM.

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"