Sub TriEquipe() '
Dim Cal As Range, col As Range, cell As Range, a As Range, z As Range, som As Range, Ligne As Long, no As Integer, iLigne As Integer
Sheets("équipe").Select
Set Cal = Range("Aj7:Aj500")
col1 = 41
For i = col1 To 59 Step 2
colonne = Split(Columns(i).Address(ColumnAbsolute:=False), ":")(1)
For Each cell In Cal
Set z = cell.Offset(0, 6)
Set a = cell.Offset(0, 5)
Set som = Range(colonne & 4)
Set col = cell.Offset(0, 6)
If cell.Offset(0, -1) = Range("ai5").Value And som.Value = 3 And AO2 <> 3 And AO2 <> 3 Then
z = 1
a = cell.Offset(0, -1) & " _" & 4
' som = som.Offset(0, 2)'marche pas
' MsgBox som
End If
If som = 4 Then
z.Select
ActiveCell.EntireColumn.Select
Selection.ClearContents
Exit For
End If
If cell.Offset(0, -1) = Range("ai5").Value And som.Value = 2 Then
z = 1
a = cell.Offset(0, -1) & " _" & 3
End If
If cell.Offset(0, -1) = Range("ai5").Value And som.Value = 1 Then
z = 1
a = cell.Offset(0, -1) & " _" & 2
End If
If som.Value = 0 Then
Range("ai5").Value = cell.Offset(0, -1)
z = 1
a = cell.Offset(0, -1) & " _" & 1
End If
'Next
Next cell
' Stop
Next i
End Sub