Bonjour à tous!
Je me demandais pourquoi mon Else ne fonctionnait pas sur un If = Arg1 or Arg2 or Arg3...
Voici mon code
Merci d'avance pour vos réflexions & bonne soirée!
Je me demandais pourquoi mon Else ne fonctionnait pas sur un If = Arg1 or Arg2 or Arg3...
Voici mon code
Code:
Option Explicit
Dim SEQPREC As Integer
Dim SEQSUIV As Integer
Private Sub CommandButton1_Click()
If TextBox1 = "25" Or "33" Or "41" Or "58" Or "66" Or "74" Or "82" Or "90" Or "17" Then
If TextBox1 = "33" Then
SEQPREC = "25"
SEQSUIV = "41"
MsgBox "La séquence précédente est " & SEQPREC & Chr(13) & "La séquence suivante est " & SEQSUIV
End If
If TextBox1 = "41" Then
SEQPREC = "33"
SEQSUIV = "59"
MsgBox "La séquence précédente est " & SEQPREC & Chr(13) & "La séquence suivante est " & SEQSUIV
End If
If TextBox1 = "58" Then
SEQPREC = "41"
SEQSUIV = "65"
MsgBox "La séquence précédente est " & SEQPREC & Chr(13) & "La séquence suivante est " & SEQSUIV
End If
If TextBox1 = "66" Then
SEQPREC = "54"
SEQSUIV = "74"
MsgBox "La séquence précédente est " & SEQPREC & Chr(13) & "La séquence suivante est " & SEQSUIV
End If
If TextBox1 = "74" Then
SEQPREC = "66"
SEQSUIV = "82"
MsgBox "La séquence précédente est " & SEQPREC & Chr(13) & "La séquence suivante est " & SEQSUIV
End If
If TextBox1 = "82" Then
SEQPREC = "74"
SEQSUIV = "90"
MsgBox "La séquence précédente est " & SEQPREC & Chr(13) & "La séquence suivante est " & SEQSUIV
End If
If TextBox1 = "90" Then
SEQPREC = "82"
SEQSUIV = "17"
MsgBox "La séquence précédente est " & SEQPREC & Chr(13) & "La séquence suivante est " & SEQSUIV
End If
If TextBox1 = "17" Then
SEQPREC = "90"
SEQSUIV = "34"
MsgBox "La séquence précédente est " & SEQPREC & Chr(13) & "La séquence suivante est " & SEQSUIV
End If
If TextBox1 = "25" Then
SEQPREC = "17"
SEQSUIV = "43"
MsgBox "La séquence précédente est " & SEQPREC & Chr(13) & "La séquence suivante est " & SEQSUIV
End If
Else
MsgBox "Cette séquence est impossible."
End If
Merci d'avance pour vos réflexions & bonne soirée!