Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Macro to password protect and allow autofilter
I am looking for a macro to set up a protection that only allows someone to
use the AutoFilter. The protection needs to set up a password for all the sheets at once. I am also wanting a macro to select all of the sheets and remove the password. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Macro to password protect and allow autofilter
Each sheet must have Autofilter enabled before protecting.
Sub auto_open() Dim ws As Worksheet For Each ws In ActiveWorkbook.Worksheets With ws .Protect Password:="justme", userinterfaceonly:=True .EnableAutoFilter = True End With Next ws End Sub To unprotect all sheets at once......... Sub UnprotectAllSheets() Application.ScreenUpdating = False Dim N As Single For N = 1 To Sheets.Count Sheets(N).Unprotect Password:="justme" Next N Application.ScreenUpdating = True End Sub Gord Dibben MS Excel MVP On Thu, 7 Aug 2008 12:30:12 -0700, NStarch wrote: I am looking for a macro to set up a protection that only allows someone to use the AutoFilter. The protection needs to set up a password for all the sheets at once. I am also wanting a macro to select all of the sheets and remove the password. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How to Protect MACRO with Password | Excel Programming | |||
Password Protect Macro | Excel Programming | |||
password protect macro | Excel Programming | |||
Password Protect Macro? | Excel Programming | |||
Password protect macro | Excel Programming |