With TextBox1 If .Text = "pass1" Or .Text = "pass2" Or .Text = "pass3" Then MsgBox("OK") Else MsgBox("Error") End If End With