Sub Speed_Comparator()
Dim WSRapAct As Worksheet, WSTabVit As Worksheet
Dim RangeRapAct As Range, RangeTabVit As Range
Dim CellRapAct As Range, CellTabVit As Range
Dim TheTimer As Single
Dim x As Integer, y As Integer
TheTimer = Timer
Set WSRapAct = ThisWorkbook.Worksheets("Rapport_Act")
Set WSTabVit = ThisWorkbook.Worksheets("Tab_Vit")
WSRapAct.Range("D:D").Interior.ColorIndex = xlNone
Set RangeRapAct = WSRapAct.Range("C2:C" & WSRapAct.Range("C1000").End(xlUp).Row)
Set RangeTabVit = WSTabVit.Range("A2:A" & WSTabVit.Range("A1000").End(xlUp).Row)
For Each CellRapAct In RangeRapAct
For Each CellTabVit In RangeTabVit
If CellRapAct.Text = CellTabVit.Text Then
With CellRapAct.Offset(0, 1)
If .Value < CellTabVit.Offset(0, 2).Value Then
.Value = CellTabVit.Offset(0, 2).Value
CellRapAct.Offset(0, 2).Interior.ColorIndex = 8 '<<<<<<<<<< c'est ici que tu dois modifier pour avoir la couleur en C
y = y + 1
Exit For
Else
If .Value > CellRapAct.Offset(0, 12) Then
CellRapAct.Offset(0, 2).Interior.ColorIndex = 33 '<<<<<<<<<< c'est ici que tu dois modifier pour avoir la couleur en C
Exit For
Else
CellRapAct.Offset(0, 2).Interior.ColorIndex = xlNone '<<<<<<<<<< c'est ici que tu dois modifier pour avoir la couleur en C
Exit For
End If
End If
End With
End If
Next CellTabVit
x = x + 1
Next CellRapAct
MsgBox x & " Comparaisons ont été faites en " & Timer - TheTimer & " Secondes" & vbCrLf _
& y & " plus grange(s) vitesse(s) historique(s) retrouvée(s)", vbInformation
End Sub