Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 22,906
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to Protect MACRO with Password Amol[_3_] Excel Programming 4 August 7th 07 10:40 PM
Password Protect Macro Dan Excel Programming 2 September 1st 06 07:13 PM
password protect macro Modell Excel Programming 3 April 27th 06 08:59 PM
Password Protect Macro? ryanmhess Excel Programming 4 January 27th 06 04:56 PM
Password protect macro Pete Excel Programming 2 April 16th 04 03:44 AM


All times are GMT +1. The time now is 07:36 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"