Auto-Filter When Workbook Protected
Thanks for your quick respond, Gord.
I tried the code that you gave me, but Nothing really happen. The screen
just flash, and nothing really get sorted, or if I can choose any filtering
criteria.
Is there a way that I can still have the custom filtering?
Here is the code that I tried:
Sub auto_filter()
With Sheets("Final")
..Unprotect Password:="justme"
..Range("A6:A38").AutoFilter
..Protect Password:="justme", userinterfaceonly:=True
..EnableAutoFilter = True
End With
End Sub
Neon520
"Gord Dibben" wrote:
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
|