1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
| Sub GRILLE()
Dim TheRow As ListRow
For i = 2 To 1000
For Each TheRow In Feuil2.ListObjects("Tab_Taux").ListRows
'On recherche la ligne qui correspond à critère Montant et Nbr de jour
If Sheets("BC").Cells(i, 5) <> "" And Sheets("BC").Cells(i, 12) <> "" And Sheets("BC").Cells(i, 8) <> "" Then
If Sheets("BC").Cells(i, 12) >= TheRow.Range(1, 1).Value And Sheets("BC").Cells(i, 12) <= TheRow.Range(1, 2).Value And Sheets("BC").Cells(i, 5) >= TheRow.Range(1, 3).Value And Sheets("BC").Cells(i, 5) <= TheRow.Range(1, 4).Value Then
'On controle le taux
If Sheets("BC").Cells(i, 8) > TheRow.Range(1, 5).Value Then
Sheets("BC").Cells(i, 8).Font.Color = RGB(255, 0, 0)
'On quitte la boucle
Exit For
End If
End If
End If
Next
Next
End Sub |
Partager