Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
using autofilter and sort, while sheet is protected | Excel Discussion (Misc queries) | |||
Autofilter in protected sheet | Excel Worksheet Functions | |||
Protected sheet and Autofilter? | Excel Programming | |||
Autofilter protected sheet | Excel Programming | |||
AutoFilter on a Protected sheet | Excel Programming |