Me again, and again with a lot of help from this board I have added a tick box that allows a person to lock out the sheet if they know the password.
I have two more questions to tweak this feature I have added.
1) Is there any way I can turn the password into *****'s in the code. The problem I have is that I will need several of these approval buttons that do certain things. This means that I will need several different passwords and I don't want to know them! neither do I want anyone else to know them. I know I can lock out the code but when one of the 3 people need to add their password or if I need to tweak the code when the sheet is in full use I will see it and turn to stone!!
2) When I untick the box, I get the password thing again which is ok but I would like to unlock the sheet again, can this be done.
I have attached the code I have for this tickbox password thing below.
Once again I bow to your support and enthusiasm.
Si
Private Sub Approve1_Click()
'
' lockout Macro
' Macro recorded 10/01/2005 by simontyler
'
line0:
P1$ = InputBox("Please enter password or press cancel")
If P1$ = "" Then GoTo line1:
If P1$ = "cen" Then GoTo line2
line1:
MsgBox ("Please enter a password")
GoTo line0
line2:
ActiveSheet.Protect P1$
Sheets("Extra").Protect P1$
End Sub
I have two more questions to tweak this feature I have added.
1) Is there any way I can turn the password into *****'s in the code. The problem I have is that I will need several of these approval buttons that do certain things. This means that I will need several different passwords and I don't want to know them! neither do I want anyone else to know them. I know I can lock out the code but when one of the 3 people need to add their password or if I need to tweak the code when the sheet is in full use I will see it and turn to stone!!
2) When I untick the box, I get the password thing again which is ok but I would like to unlock the sheet again, can this be done.
I have attached the code I have for this tickbox password thing below.
Once again I bow to your support and enthusiasm.
Si
Private Sub Approve1_Click()
'
' lockout Macro
' Macro recorded 10/01/2005 by simontyler
'
line0:
P1$ = InputBox("Please enter password or press cancel")
If P1$ = "" Then GoTo line1:
If P1$ = "cen" Then GoTo line2
line1:
MsgBox ("Please enter a password")
GoTo line0
line2:
ActiveSheet.Protect P1$
Sheets("Extra").Protect P1$
End Sub