PDA

View Full Version : Solved: Protection Problems



zoom38
03-28-2006, 04:36 PM
A few weeks ago I asked for assistance in setting up protection. I have found that I need to modify some cells and now I can't remove the protection. I've taken out the protection line with the password but when I try to unlock the worksheet it still requires a password.
Can someone please explain what is happening and how to correct this. See the code below,

Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Range)
' Sh.Protect Password:="pass", UserInterfaceOnly:=True
If Target.Cells.Count > 1 Then Exit Sub
If Not Intersect(Target, Sh.Range("B8:O34")) Is Nothing Then
Select Case Target.Value
Case "V.5", "V1" To "V999"
Target.Interior.ColorIndex = 35

Case "PL.5", "PL1" To "PL999"
Target.Interior.ColorIndex = 34

Case "SL.5", "SL1" To "SL999", "FS.5", "FS1" To "FS999"
Target.Interior.ColorIndex = 36

Case "BL.5", "BL1" To "BL999"
Target.Interior.ColorIndex = 36

Case Is = "ML.5", "ML1" To "ML999"
Target.Interior.ColorIndex = 24

Case Else
'No conditions met, so make it normal
Target.Interior.ColorIndex = -4142
End Select
End If
End Sub

It is very frustrating to be unable to work on your own spreadsheet. Thanks
Gary

Jacob Hilderbrand
03-28-2006, 04:41 PM
If the worksheet is protected, you will need to unprotect it. Commenting out the line will not unprotect it. Go to Tools | Protection | Unprotect Worksheet and enter the password.

zoom38
03-28-2006, 04:45 PM
That is my problem, no matter what I do I can't unprotect, with or without the password, with or without that line commented out.

What do I do now?

zoom38
03-28-2006, 04:59 PM
Disreguard, apparently the password in the vba code was diffierent from the sheet password. After using different variations of the passwords I normally use I was unable to unprotect it.
Thanks
Gary