'test la valeur de la cellule entre maxi en mini
If ActiveSheet.Cells(Ligne, 3) <> 999 And IsNumeric(testvc) = True Then
vc = ActiveSheet.Range(Target.Address)
If vc <> 0 Then
Select Case vc
Case vmini To vmaxi
ActiveSheet.Range(Target.Address).Font.ColorIndex = 10 'écriture en vert
ActiveSheet.Range(Target.Address).Font.Bold = False 'écriture NORMAL
Case Else
ActiveSheet.Range(Target.Address).Font.ColorIndex = 3 'écriture rouge
ActiveSheet.Range(Target.Address).Font.Bold = True 'écriture en gras
'******************************************************
'inserer code ici
Application.EnableEvents = False
If Target.Font.ColorIndex = 3 Then
Ligne = Target.Row
'remonter vers la gauche pour trouver la première font <>3 (=pièce OK)
For Colonne = Target.Column To 7 Step -1
If ((Cells(Ligne, Colonne).Value <> "") And (Cells(Ligne, Colonne).Font.ColorIndex <> 3)) Then 'condition à revoir
ici = Colonne
Exit For
End If
Next Colonne
Range(Target.Address, Cells(Ligne, Colonne)).Select
'dégriser
Selection.Interior.ColorIndex = 0
Application.EnableEvents = True
End If
'******************************************************