Tenho a seguinte estrutura montada, mas da erro de compilação: Else sem If
O que estou fazendo de errado?
If txtUsuário.Text = "" And txtSenha.Text = "" Then MsgBox " Digite Usuário e Senha", vbInformation, "Erro"
ElseIf txtUsuário.Text = "Eduardo" And txtSenha.Text = "2014" Then
Unload UserForm1
Application.Visible = True
ElseIf txtUsuário.Text <> "Eduardo" And txtSenha.Text <> "2014" Then
MsgBox " Usuário ou Senha inválidos", vbInformation, "Erro"
ElseIf txtUsuário.Text = "Eduardo" And txtSenha.Text <> "2014" Then
MsgBox " Usuário ou Senha inválidos", vbInformation, "Erro"
ElseIf txtUsuário.Text <> "Eduardo" And txtSenha.Text = "2014" Then
MsgBox " Usuário ou Senha inválidos", vbInformation, "Erro"
End If
End Sub
Grato pela ajuda, aguardo resposta!
O que estou fazendo de errado?
If txtUsuário.Text = "" And txtSenha.Text = "" Then MsgBox " Digite Usuário e Senha", vbInformation, "Erro"
ElseIf txtUsuário.Text = "Eduardo" And txtSenha.Text = "2014" Then
Unload UserForm1
Application.Visible = True
ElseIf txtUsuário.Text <> "Eduardo" And txtSenha.Text <> "2014" Then
MsgBox " Usuário ou Senha inválidos", vbInformation, "Erro"
ElseIf txtUsuário.Text = "Eduardo" And txtSenha.Text <> "2014" Then
MsgBox " Usuário ou Senha inválidos", vbInformation, "Erro"
ElseIf txtUsuário.Text <> "Eduardo" And txtSenha.Text = "2014" Then
MsgBox " Usuário ou Senha inválidos", vbInformation, "Erro"
End If
End Sub
Grato pela ajuda, aguardo resposta!