Posted to microsoft.public.excel.programming
|
|
Automatic Unprotect / Protect
Hi Samuel
I left two ".Select" statements in there that should be deleted. They're on
the lines:
With Sheets("Billing").Select
and
With Sheets("Extra Fees Calculator").Select
You might also need to delete the line:
..ScrollColumn = 1
Sorry, for the confusion.
Cheers
--
macropod
[MVP - Microsoft Word]
"SamuelT" wrote in
message ...
Hi macropod,
Thanks for that. I've just tried to run the macro, but get a run-time
error 448. It doesn't seem to like the highlighted line:
Sub PF()
Dim Pwd As String
Pwd = "drowssap"
With Sheets("Programme (2 Week)")
.Unprotect Password:=Pwd
.AutoFilter Field:=9, Criteria1:="Peter Farrant"
.Protect DrawingObjects:=True, Contents:=True, _
Scenarios:=True, Password:=Pwd
End With
With Sheets("Programme (High Level)")
.Unprotect Password:=Pwd
.AutoFilter Field:=9, Criteria1:="Peter Farrant"
.Protect DrawingObjects:=True, Contents:=True, _
Scenarios:=True, Password:=Pwd
End With
With Sheets("Capacity")
.Unprotect Password:=Pwd
.AutoFilter Field:=5, Criteria1:="Peter Farrant"
.Protect DrawingObjects:=True, Contents:=True, _
Scenarios:=True, Password:=Pwd
End With
With Sheets("Components")
.Unprotect Password:=Pwd
.AutoFilter Field:=3, Criteria1:="Peter Farrant"
.Protect DrawingObjects:=True, Contents:=True, _
Scenarios:=True, Password:=Pwd
End With
With Sheets("Billing").Select
.Unprotect Password:=Pwd
.ScrollColumn = 1
.AutoFilter Field:=3, Criteria1:="Peter Farrant"
.Protect DrawingObjects:=True, Contents:=True, _
Scenarios:=True, Password:=Pwd
End With
With Sheets("Extra Fees Calculator").Select
.Unprotect Password:=Pwd
.AutoFilter Field:=3, Criteria1:="Peter Farrant"
.Protect DrawingObjects:=True, Contents:=True, _
Scenarios:=True, Password:=Pwd
End With
End Sub
Any suggestions?
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
|