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
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