LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Automatic Unprotect / Protect


Hi all,

I've got a spreadsheet that a number of people view. I've recorded a
macro so that each person can press a button and only their information
is displayed. This works fine and dandy.

My problem arises where I have protected sheets, which - in recording
the macro - I unprotected to run the autofilter, then reprotected once
the filtration was complete. I'd like Excel to automatically go through
this process rather than prompting the user for the password (the whole
point is so they can't change certain columns of data).

Here is the macro as it currently stands:

Sub PF()
'
' PF Macro
' Macro recorded 06/06/2006 by SamuelT
'

'
Sheets("Programme (2 Week)").Select
ActiveSheet.Unprotect
Selection.AutoFilter Field:=9, Criteria1:="Peter Farrant"
ActiveSheet.Protect DrawingObjects:=True, Contents:=True,
Scenarios:=True
Sheets("Programme (High Level)").Select
ActiveSheet.Unprotect
Selection.AutoFilter Field:=9, Criteria1:="Peter Farrant"
ActiveSheet.Protect DrawingObjects:=True, Contents:=True,
Scenarios:=True
Sheets("Capacity").Select
ActiveSheet.Unprotect
Selection.AutoFilter Field:=5, Criteria1:="Peter Farrant"
ActiveSheet.Protect DrawingObjects:=True, Contents:=True,
Scenarios:=True
Sheets("Components").Select
ActiveSheet.Unprotect
Selection.AutoFilter Field:=3, Criteria1:="Peter Farrant"
ActiveSheet.Protect DrawingObjects:=True, Contents:=True,
Scenarios:=True
Sheets("Billing").Select
ActiveSheet.Unprotect
ActiveWindow.ScrollColumn = 1
Selection.AutoFilter Field:=3, Criteria1:="Peter Farrant"
ActiveSheet.Protect DrawingObjects:=True, Contents:=True,
Scenarios:=True
ActiveWindow.ScrollWorkbookTabs Position:=xlLast
Sheets("Extra Fees Calculator").Select
ActiveSheet.Unprotect
Selection.AutoFilter Field:=3, Criteria1:="Peter Farrant"
ActiveSheet.Protect DrawingObjects:=True, Contents:=True,
Scenarios:=True
ActiveWindow.ScrollWorkbookTabs Position:=xlFirst
Sheets("Programme (2 Week)").Select
End Sub

Can anyone suggest what I might alter/add/edit to automatically
unprotect and reprotect the worksheets?

TIA,

SamuelT


--
SamuelT
------------------------------------------------------------------------
SamuelT's Profile: http://www.excelforum.com/member.php...o&userid=27501
View this thread: http://www.excelforum.com/showthread...hreadid=548879

 
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
Protect, unprotect Pyrite Excel Discussion (Misc queries) 0 August 15th 08 03:18 PM
Protect UserInterface VS Protect/Unprotect Desert Piranha[_44_] Excel Programming 2 February 1st 06 03:08 AM
protect and unprotect Andrew[_51_] Excel Programming 1 October 13th 05 07:24 PM
protect and unprotect Andrew[_51_] Excel Programming 2 October 13th 05 06:44 PM
Unprotect and protect.... Wilfrid Excel Programming 1 July 28th 04 03:13 AM


All times are GMT +1. The time now is 12:50 PM.

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

About Us

"It's about Microsoft Excel"