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

I have a sheet that is protected but I checked the box that says allow auto
filter and it works fine except if I run a macro where I capture what I want
to filter in a variable and try to do the auto filter in the macro it returns
and error telling me the sheet is protected.

This is what I use in the program to filter:

Selection.AutoFilter Field:=4, Criteria1:=vFilterItem

What am I not doing?

Thank you for your help.

Steven
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 644
Default Protected Sheet and AutoFilter

have you tried programmatically unprotecting and re-protecting the
sheet?
ActiveSheet.Unprotect "YourPassword"
Selection.AutoFilter Field:=4, Criteria1:=vFilterItem
ActiveSheet.Protect "YourPassword"

Charles

Steven wrote:
I have a sheet that is protected but I checked the box that says allow auto
filter and it works fine except if I run a macro where I capture what I want
to filter in a variable and try to do the auto filter in the macro it returns
and error telling me the sheet is protected.

This is what I use in the program to filter:

Selection.AutoFilter Field:=4, Criteria1:=vFilterItem

What am I not doing?

Thank you for your help.

Steven


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Protected Sheet and AutoFilter

the enableautofilter allows you to change the criteria of an existing filter
(applied before protection was applied). It doesn't allow you to apply a
new autofilter if one didn't exist. Could that be the problem?

Unprotecting as Charles suggests would be a work around in that case.

--
Regards,
Tom Ogilvy

"Steven" wrote in message
...
I have a sheet that is protected but I checked the box that says allow auto
filter and it works fine except if I run a macro where I capture what I
want
to filter in a variable and try to do the auto filter in the macro it
returns
and error telling me the sheet is protected.

This is what I use in the program to filter:

Selection.AutoFilter Field:=4, Criteria1:=vFilterItem

What am I not doing?

Thank you for your help.

Steven



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
using autofilter and sort, while sheet is protected mariekek5 Excel Discussion (Misc queries) 0 June 17th 09 01:13 PM
Autofilter in protected sheet Javier Excel Worksheet Functions 5 March 24th 08 05:56 PM
Protected sheet and Autofilter? harpscardiff[_19_] Excel Programming 4 January 25th 06 05:58 PM
Autofilter protected sheet vecia[_4_] Excel Programming 4 September 10th 05 08:25 AM
AutoFilter on a Protected sheet Olle[_2_] Excel Programming 1 June 15th 04 08:12 AM


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