Re : execution macro?
hello,
merci ca marche super bien....
mais voila... j'ai regarder dans l'aide intersect, select case, etc.. et je n'arrives pas a une nouvelle évolution que je souhaites faire....
Voila.. je souhaites vérifier la colonne B (critique, Majeure, mineure, etc...) en fonction de la cellule en colonne B et du resultat de la colonne C ( 1, 2, 3 etc...) alors la colonnes C sera rouge ou verte, etc....
mon code en est a ce stade.. mais ca ne marche po 🙁
Private Sub Worksheet_Change(ByVal Target As Range)
If Not Intersect(Target, Range("T2:T200")) Is Nothing Then
Select Case Target.Value
Case Is > 1: Target.Interior.ColorIndex = 3
Case Is = 1: Target.Interior.ColorIndex = 4
Case Is = 0: Target.Interior.ColorIndex = 2
'pour tous les autres cas
Case Else: Target.Interior.ColorIndex = xlColorIndexAutomatic
End Select
End If
If Not Intersect(Target, Range("B2:B200")) Is Nothing Then
Select Case Target
Case "Critique": Target.Interior.ColorIndex = 3
Case "Majeure": Target.Interior.ColorIndex = 45
Case "Mineure": Target.Interior.ColorIndex = 4
Case "IR": Target.Interior.ColorIndex = 6
Case "OR": Target.Interior.ColorIndex = 23
'pour tous les autres cas
Case Else: Target.Interior.ColorIndex = xlColorIndexAutomatic
End Select
End If
If Not Intersect(Target, Range("B2:B200")) Is Nothing Then
Select Case Target
Case "Critique":
If Not Intersect(Target, Range("U2:U200")) Is Nothing Then
Select Case Target.Value
Case Is > 10: Target.Interior.ColorIndex = 3
Case Is = 10: Target.Interior.ColorIndex = 4
Case Is = 0: Target.Interior.ColorIndex = 2
'pour tous les autres cas
Case Else: Target.Interior.ColorIndex = xlColorIndexAutomatic
End Select
End If
Case Else: Target.Interior.ColorIndex = xlColorIndexAutomatic
End Select
End If
End Sub
En esperant pouvoir retrouver de l'aide 🙂
@+++