View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Gord Dibben Gord Dibben is offline
external usenet poster
 
Posts: 22,906
Default Auto-Filter When Workbook Protected

Sub auto_filter()
With Sheets("Sheet1")
.Range("A1").AutoFilter
.Protect Password:="justme", userinterfaceonly:=True
.EnableAutoFilter = True
End With
End Sub

There are other ways to run the code.

Sheet_Activate event comes to mind.


Gord Dibben MS Excel MVP

On Wed, 24 Dec 2008 09:50:01 -0800, Neon520
wrote:

Hi everyone,

I'm copying data from several workbooks in a Folder to a separate summary
sheet. I really like the Auto Filter (Custom Filter...) in Excel. It would
be REALLY REALLY great to have a macro that can do just about the same thing
as what (Custom Filter...) does. By the same, I mean the CRITERIA section of
"equal", "not equal", "greater than" and so on... (You get the point)

However, since I'm suck with Macro or VBA, I'm trying to have creative way
to get my work done. So I'm thinking about why not copying everything to the
summary sheet and then do a custom filtering of auto-filter. But again, I
hit another bump. They are disable by default if the sheet is protected.
The reason I have my sheet protected is I don't others to mess up the formula
in there.

So does anyone knows if there is a way to either IMPLEMENT custom filtering
of Auto Filter in Macro or Enable Custom Filtering when sheet is protected?

Thanks for any help!
Neon520