Sub Combinaisons()
Ratio = [J1]: RatioMin = [J3]: RatioMax = [J4] ' Transfert des ratios
IndexW = 8 ' Index d'ecriture dans matrice résultats
For Index1 = 7 To 21 ' Toutes lignes du tableau 1
For Index2 = 30 To 50 ' Toutes lignes du tableau 2
For C = 4 To 6 Step 2 ' Les deux colonnes
T11 = Cells(Index1, 3): T12 = Cells(Index1, C)
T21 = Cells(Index2, 3): T22 = Cells(Index2, C)
If T11 = "/" Or T12 = "/" Or T21 = "/" Or T22 = "/" Then GoTo NextOne ' Si / on sort
If T12 + T22 = 0 Then GoTo NextOne ' On sort si diviseur=0
RatioEnCours = (T11 + T21) / (T12 + T22) ' Calcul du ratio
If RatioEnCours >= RatioMin And RatioEnCours <= RatioMax Then ' Si dans les clous on stocke
Range("J" & IndexW) = Range("A" & Index1)
Range("K" & IndexW) = Cells(1, C)
Range("M" & IndexW) = Range("A" & Index2)
Range("N" & IndexW) = Cells(1, C)
Range("O" & IndexW) = RatioEnCours
Range("P" & IndexW) = Abs(RatioEnCours - Ratio) / Ratio
IndexW = IndexW + 1
End If
NextOne:
Next C
Next Index2
Next Index1
End Sub