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
| Private Sub Worksheet_Change(ByVal Target As Range)
n = Target.Row
Dim NumSafetyEasy As Long
For x = 1 To 17
If Cells(n, 1) <> "" And Cells(n, 6) <> "" And Cells(n, 7) = "Ok" And Cells(n, 9) <> "" And Cells(n, 11) <> "" And (Cells(n, 15) = "" Or Cells(n, 16) = "") Then
Cells(n, x).Interior.ColorIndex = 44
End If
If Cells(n, 4) = "SAE canceled" And Cells(n, 17) = "Validé" Then
Cells(n, x).Interior.ColorIndex = 41
End If
If Cells(n, 4) = "SAE canceled" And Cells(n, 17) = "Validé" Then
NumSafetyEasy = Cells(n, 6)
End If
If Cells(n, 4) = "SAE canceled" And Cells(n, 17) = "Validé" Then
Range("V1").Value = NumSafetyEasy
End If
If Application.Intersect(Range("V1"), Target) Is Nothing Then
For a = 9 To 100
For b = 1 To 17
If Cells(a, 6) = Range("V1").Value Then
Cells(a, b).Interior.ColorIndex = 2
End If
Next b '
Next a '
End If
Next x '
End Sub |
Partager