1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
| Sub couleur()
Dim C As Range
With ActiveSheet
.[A13:Q43].Interior.ColorIndex = xlNone
For Each C In .Range(.[A13], .Cells(.Rows.Count, 1).End(xlUp))
If Application.Weekday(C.Value) = 4 Then
C.Resize(, 17).Interior.ColorIndex = 15
Intersect(C.EntireRow, Union(.[D:E], .[G:H], .[J:K], .[M:O])).Value = #12:00:00 AM#
Intersect(C.EntireRow, .[P:Q]).Value = ""
ElseIf Application.Weekday(C.Value, 2) > 5 Then
C.Resize(, 17).Interior.ColorIndex = 3
Intersect(C.EntireRow, Union(.[D:E], .[G:H], .[J:K], .[M:O])).Value = #12:00:00 AM#
Intersect(C.EntireRow, .[P:Q]).Value = ""
End If
Next C
.[P:Q].NumberFormat = "hh:mm"
End With
End Sub |
Partager