1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
| Bonjour,
Je ne suis pas limité à la ligne 5, je ne sais pas si j'ai bien fait :
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Column = 7 Or Target.Column = 9 Or Target.Address = "$A$1" Then
If Cells(Target.Row, 9) = "" Then
Cells(Target.Row, 7).Interior.ColorIndex = xlNone
ElseIf IsDate(Cells(Target.Row, 9)) And Cells(Target.Row, 9) < [A1] Then
Cells(Target.Row, 7).Interior.ColorIndex = 4
ElseIf [A1] - Cells(Target.Row, 9) >= 15 Then
Cells(Target.Row, 7).Interior.ColorIndex = 46
ElseIf [A1] < Cells(Target.Row, 9) Then
Cells(Target.Row, 7).Interior.ColorIndex = 3
End If
End If
Intersect(Rows(4), Range("G:G,J:J,M:M,P:P,S:S,V:V,Y:Y,AB:AB,AE:AE,AH:AH,AK:AK,AN:AN,AQ:AQ,AT:AT,AW:AW")).Select
If Not Intersect(Rows(4), Range("G:G,J:J,M:M,P:P,S:S,V:V,Y:Y,AB:AB,AE:AE,AH:AH,AK:AK,AN:AN,AQ:AQ,AT:AT,AW:AW")) Is Nothing Then
Cells(Target.Row, 7).Interior.ColorIndex = 6
End If
End Sub |
Partager