streub
10-19-2013, 07:32 AM
I need to utilize the password "25624" located on sheet c, range I2 rather than having it included in the sub. I keep getting an error.
Private Sub CommandButton2_Click()
If TextBox2.Value = "25624" Then '<<<<<<<<
ComboBox1.Visible = True
TextBox1.Visible = True
CommandButton3.Visible = True
Range("h18").Value = "From"
Range("I18").Value = "To"
End If
If TextBox2.Value <> "25624" Then '<<<<<<<<
MsgBox "You Do Not Have Authorization"
ComboBox1.Value = ""
ComboBox1.Visible = False
TextBox1.Value = ""
TextBox1.Visible = False
TextBox2.Value = ""
CommandButton3.Visible = False
Range("h18:i18").ClearContents
End If
End Sub
Private Sub CommandButton2_Click()
If TextBox2.Value = "25624" Then '<<<<<<<<
ComboBox1.Visible = True
TextBox1.Visible = True
CommandButton3.Visible = True
Range("h18").Value = "From"
Range("I18").Value = "To"
End If
If TextBox2.Value <> "25624" Then '<<<<<<<<
MsgBox "You Do Not Have Authorization"
ComboBox1.Value = ""
ComboBox1.Visible = False
TextBox1.Value = ""
TextBox1.Visible = False
TextBox2.Value = ""
CommandButton3.Visible = False
Range("h18:i18").ClearContents
End If
End Sub