Turning Filters ON in a Protected Shared Worksheet

  • Thread starter Thread starter Gary
  • Start date Start date
G

Gary

I have a shared worksheet that needs to have columns
protected. I also need filters on.

I can do it with VB in a non shared worksheet.

Must I use VB and can you help?

Thanks
Gary
 
Before xl2002:

if the workbook isn't shared, you can protect the sheet in code and allow the
existing autofilter arrows to work:

Option Explicit
Sub auto_open()
With Worksheets("Sheet1")
.Protect Password:="hi", _
DrawingObjects:=False, Contents:=True, Scenarios:=True, _
userinterfaceonly:=True
.EnableAutoFilter = True
End With
End Sub

It needs to be reset each time you open the workbook. (excel doesn't remember
it after closing the workbook.)

(you could use the workbook_open even under ThisWorkbook, too.)

====
But when the workbook is shared, you can't change the worksheet protection--so
this code will fail.

====

Starting with xl2002, there's an option under tools|protection that allows
existing autofilters to work.

And they work on a shared workbook.

I think you'll have to upgrade to xl2002 (if you're not there already) to use
autofilter on a protected worksheet in a shared workbook.

I don't think that there's a workaround in earlier versions.
 
Back
Top