K
Khalil Handal
A worksheet has password created using the "Tools" -> "Protection".
Inside the sheet there is a check box. It has a VBA Code as follows:
Private Sub CheckBox1_Click()
Me.Unprotect Password:="1230"
If CheckBox1.Value = True Then
Me.Range("C34:I35").Font.Color = vbBlack
Else
Me.Range("C34:I35").Font.Color = vbWhite
End If
Me.Protect Password:="1230"
ActiveSheet.Protect AllowFormattingRows:=True
End Sub
I changed the password in the code to: 2130 (an example).
My problem is when I go to the "Protection" in the Tools Menu and choose the
"unprotect" It does not ask me for the password.
It is automatically unprotected.
I tried to use the same password from the VB Code and the Tools Menu and
still has the same problem: It unprotect the sheet without asking for the
Password.
I am using Excel 2003
Any Suggestions!
Inside the sheet there is a check box. It has a VBA Code as follows:
Private Sub CheckBox1_Click()
Me.Unprotect Password:="1230"
If CheckBox1.Value = True Then
Me.Range("C34:I35").Font.Color = vbBlack
Else
Me.Range("C34:I35").Font.Color = vbWhite
End If
Me.Protect Password:="1230"
ActiveSheet.Protect AllowFormattingRows:=True
End Sub
I changed the password in the code to: 2130 (an example).
My problem is when I go to the "Protection" in the Tools Menu and choose the
"unprotect" It does not ask me for the password.
It is automatically unprotected.
I tried to use the same password from the VB Code and the Tools Menu and
still has the same problem: It unprotect the sheet without asking for the
Password.
I am using Excel 2003
Any Suggestions!