Erreur If...then...else en VBA
Résolu
Mehdi Ier
-
galijo Messages postés 97 Date d'inscription Statut Membre Dernière intervention -
galijo Messages postés 97 Date d'inscription Statut Membre Dernière intervention -
Bonjour!
Je serais curieux de savoir ce qu'il y a de faux dans cette instruction
Cells(i, 3).Value = InputBox("Entrez un compte")
If Cells(i, 3).Value = "0" Then i = i + 1
ElseIf Cells(i, 3).Value = "1" Then Exit Sub
Else: j = 4
End If
Merci!
Je serais curieux de savoir ce qu'il y a de faux dans cette instruction
Cells(i, 3).Value = InputBox("Entrez un compte")
If Cells(i, 3).Value = "0" Then i = i + 1
ElseIf Cells(i, 3).Value = "1" Then Exit Sub
Else: j = 4
End If
Merci!
A voir également:
- Erreur If...then...else en VBA
- Erreur 0x80070643 - Accueil - Windows
- Erreur 0x80070643 Windows 10 : comment résoudre le problème de la mise à jour KB5001716 - Accueil - Windows
- Erreur 4101 france tv - Forum Lecteurs et supports vidéo
- Erreur 4201 france tv ✓ - Forum Réseaux sociaux
- J'aime par erreur facebook notification - Forum Facebook
8 réponses
les :
Cells(i, 3).Value = InputBox("Entrez un compte")
If Cells(i, 3).Value = "0" Then i = i + 1
ElseIf Cells(i, 3).Value = "1" Then Exit Sub
Else: j = 4
End If
JSS.j'ai.bon.la?
Cells(i, 3).Value = InputBox("Entrez un compte")
If Cells(i, 3).Value = "0" Then i = i + 1
ElseIf Cells(i, 3).Value = "1" Then Exit Sub
Else: j = 4
End If
JSS.j'ai.bon.la?
Bon, ben finalement, j'ai foutu toutes les instructions à la ligne et ça marche, donc merci.
?????????????????????????
?????????????????????????
Vous n’avez pas trouvé la réponse que vous recherchez ?
Posez votre question
salut c'est quoi le problème ici quand je débogue il fait quelque fois de fausses opérations
Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim X As Int32 = TextBox1.Text
Dim Y As Int32 = TextBox2.Text
TextBox3.Text = (X + Y)
End Sub
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
Dim X As Integer = TextBox1.Text
Dim Y As Integer = TextBox2.Text
TextBox3.Text = (X - Y)
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
Dim X As Integer = TextBox1.Text
Dim Y As Integer = TextBox1.Text
TextBox3.Text = (X * Y)
End Sub
Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click
Dim X As Integer = TextBox1.Text
Dim Y As Integer = TextBox1.Text
TextBox3.Text = (X / Y)
End Sub
Private Sub Button5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button5.Click
Dim X As Integer = TextBox1.Text
Dim Y As Integer = TextBox1.Text
If TextBox3.Text = (X + Y) Then TextBox3.Text = (X + Y)
If TextBox3.Text = (X - Y) Then TextBox3.Text = (X - Y)
If TextBox3.Text = (X * Y) Then TextBox3.Text = (X * Y)
If TextBox3.Text = (X / Y) Then TextBox3.Text = (X / Y)
End Sub
End Class
Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim X As Int32 = TextBox1.Text
Dim Y As Int32 = TextBox2.Text
TextBox3.Text = (X + Y)
End Sub
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
Dim X As Integer = TextBox1.Text
Dim Y As Integer = TextBox2.Text
TextBox3.Text = (X - Y)
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
Dim X As Integer = TextBox1.Text
Dim Y As Integer = TextBox1.Text
TextBox3.Text = (X * Y)
End Sub
Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click
Dim X As Integer = TextBox1.Text
Dim Y As Integer = TextBox1.Text
TextBox3.Text = (X / Y)
End Sub
Private Sub Button5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button5.Click
Dim X As Integer = TextBox1.Text
Dim Y As Integer = TextBox1.Text
If TextBox3.Text = (X + Y) Then TextBox3.Text = (X + Y)
If TextBox3.Text = (X - Y) Then TextBox3.Text = (X - Y)
If TextBox3.Text = (X * Y) Then TextBox3.Text = (X * Y)
If TextBox3.Text = (X / Y) Then TextBox3.Text = (X / Y)
End Sub
End Class