chem101
11-22-2010, 09:10 AM
Hello Everyone,
I would like to protect and unprotect cells J28 and J29 based on an items selected from a drop down window in another cell. J28 and J29 share conditional formatting for two items that are selected from the drop down window in the other cell I mentioned. If values other than these two items are selected I would like J28 and J29 to be protected. I'm having trouble placing both items in the code's argument. Here's what I have so far:
If wksEsInput.Range("InputStyle") <> "ABC" Or "DEF" Then
wksEsInput.Unprotect Password:="Jaxx"
wksEsInput.Range("J28:J28").Locked = True
wksEsInput.Protect _
Password:="Jaxx", _
UserInterfaceOnly:=True, _
AllowFormattingCells:=True
End If
If wksEsInput.Range("InputStyle") = "ABC" or "DEF" Then
wksEsInput.Unprotect Password:="Jaxx"
wksEsInput.Range("J28:J28").Locked = False
wksEsInput.Protect _
Password:="Jaxx", _
UserInterfaceOnly:=True, _
AllowFormattingCells:=True
End If
Any help you can provide will be greatly appreciated!!
Thank you!
I would like to protect and unprotect cells J28 and J29 based on an items selected from a drop down window in another cell. J28 and J29 share conditional formatting for two items that are selected from the drop down window in the other cell I mentioned. If values other than these two items are selected I would like J28 and J29 to be protected. I'm having trouble placing both items in the code's argument. Here's what I have so far:
If wksEsInput.Range("InputStyle") <> "ABC" Or "DEF" Then
wksEsInput.Unprotect Password:="Jaxx"
wksEsInput.Range("J28:J28").Locked = True
wksEsInput.Protect _
Password:="Jaxx", _
UserInterfaceOnly:=True, _
AllowFormattingCells:=True
End If
If wksEsInput.Range("InputStyle") = "ABC" or "DEF" Then
wksEsInput.Unprotect Password:="Jaxx"
wksEsInput.Range("J28:J28").Locked = False
wksEsInput.Protect _
Password:="Jaxx", _
UserInterfaceOnly:=True, _
AllowFormattingCells:=True
End If
Any help you can provide will be greatly appreciated!!
Thank you!