Hello!!
I am trying to password protect 2 worksheets using VB. I have started the coding but the forum box is not disappearing after the user inputs the correct or incorrect password.
I hope you can help.
I want the userforum box to appear as soon as the workbook is open.
Here is what I have so far.
Private Sub workbook_before(cancel As Boolean)
Sheets("Score Weight").Visible = False
Sheets("Summary").Visible = False
End Sub
Private Sub Workbook_Open()
Administrator.Show
End Sub
Sub CommandButton2_Click()
If (TextBox1.Value = "hawkeye") Then
Sheets("Score Weight").Visible = True
Sheets("Summary").Visible = True
Sheets("Partner Score Form").Select
Else
Sheets("Score Weight").Visible = False
Sheets("Summary").Visible = False
retry = MsgBox("The Password is incorrect. Do you wish to try again?", vbYesNo, "Retry?")
Select Case retry
Case Is = vbYes
TextBox1.Value = ""
TextBox1.SetFocus
Show
Case Is = vbNo
Show
End Select
End If
End Sub
I am trying to password protect 2 worksheets using VB. I have started the coding but the forum box is not disappearing after the user inputs the correct or incorrect password.
I hope you can help.
I want the userforum box to appear as soon as the workbook is open.
Here is what I have so far.
Private Sub workbook_before(cancel As Boolean)
Sheets("Score Weight").Visible = False
Sheets("Summary").Visible = False
End Sub
Private Sub Workbook_Open()
Administrator.Show
End Sub
Sub CommandButton2_Click()
If (TextBox1.Value = "hawkeye") Then
Sheets("Score Weight").Visible = True
Sheets("Summary").Visible = True
Sheets("Partner Score Form").Select
Else
Sheets("Score Weight").Visible = False
Sheets("Summary").Visible = False
retry = MsgBox("The Password is incorrect. Do you wish to try again?", vbYesNo, "Retry?")
Select Case retry
Case Is = vbYes
TextBox1.Value = ""
TextBox1.SetFocus
Show
Case Is = vbNo
Show
End Select
End If
End Sub