Bonjour, Je voudrais boucler du textbox8 au textbox22 avec se code :
Private Sub TextBox9_Change()
If TextBox8 = TextBox9 Then
TextBox9.BackColor = vbGreen
CommandButton1.Enabled = True
Else
TextBox9.BackColor = vbRed
CommandButton1.Enabled = False
End If
End Sub
J'ai essayer ceci mais sa ne fonctionne pas :
Sub Textbox(i)_change()
For i = 8 To 22
If USF5.Controls("TextBox" & i) = USF5.Controls("TextBox" & (i+1)) Then
CommandButton1.Enabled = True
TextBox(i+1).BackColor = vbGreen
Else
CommandButton1.Enabled = False
TextBox(i+1).BackColor = vbRed
End If
Next i
End Sub
Quelqu'un peux m'aider ? merci