P
PKyle
I have a workbook with 5 active worksheets. The firt worksheet is named
"request".
If "request" is the active worksheet, it locks the fields below.... if I am
on another worksheet, it does not lock the fields in "request" as noted
below.
What did I miss?
Thanks
Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As
Boolean)
Sheets("Request").Range("K4") = Now
Set wks = Me.Worksheets("request")
ActiveWorkbook.Unprotect password:="mypassword"
ActiveSheet.Unprotect password:="mypassword"
Range("B4:B9").Select
Selection.Locked = True
Range("J2:M2").Select
Selection.Locked = True
Range("A26:L33").Select
Selection.Locked = True
Range("A14:L22").Select
Selection.Locked = True
Range("A39:L54").Select
Selection.Locked = True
Range("A55:L60").Select
Selection.Locked = True
Range("K4:K9").Select
Selection.Locked = True
ActiveSheet.Protect password:="mypassword"
ActiveWorkbook.Protect password:="mypassword"
End Sub
"request".
If "request" is the active worksheet, it locks the fields below.... if I am
on another worksheet, it does not lock the fields in "request" as noted
below.
What did I miss?
Thanks
Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As
Boolean)
Sheets("Request").Range("K4") = Now
Set wks = Me.Worksheets("request")
ActiveWorkbook.Unprotect password:="mypassword"
ActiveSheet.Unprotect password:="mypassword"
Range("B4:B9").Select
Selection.Locked = True
Range("J2:M2").Select
Selection.Locked = True
Range("A26:L33").Select
Selection.Locked = True
Range("A14:L22").Select
Selection.Locked = True
Range("A39:L54").Select
Selection.Locked = True
Range("A55:L60").Select
Selection.Locked = True
Range("K4:K9").Select
Selection.Locked = True
ActiveSheet.Protect password:="mypassword"
ActiveWorkbook.Protect password:="mypassword"
End Sub