View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
Debra Dalgleish
 
Posts: n/a
Default AutoFilter on Protected Worksheet Excel 2003

When you protect the worksheet, and enable AutoFilter in the list, it
allows users to use an existing AutoFilter, but they can't create a new one.

There's sample code here that checks for a filter when opening a
workbook, then protects the sheet:

http://www.contextures.com/xlautofilter03.html#Protect

aehan wrote:
Has anyone else come across this, or am I doing something wrong? In Excel
2003 I protected a worksheet, enabling the AutoFilter in the list of
protection options. However, even though I did this, I couldn't turn
AutoFilter on. I looked up help, which said that enabling the AutoFilter in
the protection options is all you had to do. It also gave some code for use
in earlier versions. I used the code and the AutFilter works!! However, it
definitely doesn't simply by enabling it in the list of protection options.
Has anyone else come across this? the code is:

Sub test()

Results.Protect Password:="test", DrawingObjects:=True, _
contents:=True, Scenarios:=True, _
userinterfaceonly:=True
Results.EnableAutoFilter = True
End Sub

This solution works perfectly, but I am frustrated that the simple option
for Excel 2003 doesn't seem to work. I train other people who don't
necessarily understand code.

Cheers
Aehan



--
Debra Dalgleish
Contextures
http://www.contextures.com/tiptech.html