JonnyB
04-13-2015, 08:03 AM
Hi,
Could anyone help me add a password in to the following togglebutton code
Private Sub ToggleButton21_Click()
If ToggleButton21.Value = False Then
ToggleButton21.BackColor = vbGreen
Else
ToggleButton21.BackColor = vbRed
End If
If ToggleButton21.Value = False Then
ActiveSheet.Unprotect
Else
If ToggleButton21.Value = True Then
ActiveSheet.Protect
End If
End If
Select Case ToggleButton21.Value
Case True
ToggleButton21.Caption = "Locked"
Case False
ToggleButton21.Caption = "Unlocked"
End Select
End Sub
thanks
Jon
Could anyone help me add a password in to the following togglebutton code
Private Sub ToggleButton21_Click()
If ToggleButton21.Value = False Then
ToggleButton21.BackColor = vbGreen
Else
ToggleButton21.BackColor = vbRed
End If
If ToggleButton21.Value = False Then
ActiveSheet.Unprotect
Else
If ToggleButton21.Value = True Then
ActiveSheet.Protect
End If
End If
Select Case ToggleButton21.Value
Case True
ToggleButton21.Caption = "Locked"
Case False
ToggleButton21.Caption = "Unlocked"
End Select
End Sub
thanks
Jon