Private Sub Controle_Num_Equipe()
Sheets("Equipes").Select
Range("B3").Select
For i = 1 To 200
If Cells(i + 2, 2).Value = "" Then
Range("RepereNumeroEquipe").ClearContents
Exit For
End If
If Txtb_Num_Equip_1.Value = i And Txtb_Num_Partie.Value = 1 Then
If Cells(i + 2, 4).Value <> "" Then
Range("RepereNumeroEquipe").Value = "X"
MsgBox "Vous avez déjà saisie" & Chr(13) & "le numéro de la première équipe.", _
vbOKOnly + vbInformation, "Informations imcomplètes"
Exit Sub
End If
ElseIf Txtb_Num_Equip_1.Value = i And Txtb_Num_Partie.Value = 2 Then
If Cells(i + 2, 5).Value <> "" Then
Range("RepereNumeroEquipe").Value = "X"
MsgBox "Vous avez déjà saisie" & Chr(13) & "le numéro de la première équipe.", _
vbOKOnly + vbInformation, "Informations imcomplètes"
Exit Sub
End If
ElseIf Txtb_Num_Equip_1.Value = i And Txtb_Num_Partie.Value = 3 Then
If Cells(i + 2, 6).Value <> "" Then
Range("RepereNumeroEquipe").Value = "X"
MsgBox "Vous avez déjà saisie" & Chr(13) & "le numéro de la première équipe.", _
vbOKOnly + vbInformation, "Informations imcomplètes"
Exit Sub
End If
ElseIf Txtb_Num_Equip_1.Value = i And Txtb_Num_Partie.Value = 4 Then
If Cells(i + 2, 7).Value <> "" Then
Range("RepereNumeroEquipe").Value = "X"
MsgBox "Vous avez déjà saisie" & Chr(13) & "le numéro de la première équipe.", _
vbOKOnly + vbInformation, "Informations imcomplètes"
Exit Sub
End If
Else
Cells(i + 3, 2).Select
End If
Next i
End Sub