Bonsoir,
Je ne sais pas trop pourquoi ma formule est longue, mais elle s'inspire de ce qui a été présenté plus haut et fonctionne très bien.
Sub colorday()
Dim sh As Worksheet, sem As Long, d As Long
Dim dat As Date, j1 As Long
d = Range("day").Value
For Each sh In Worksheets
If IsDate(sh.[C2].Value) Then
dat = sh.[C2].Value
If sh.Name = "Date" Then
Else
If sh.Name <> d Then
j1 = Weekday(DateSerial(Year(dat), Month(dat), 1), vbMonday)
If Weekday(sh.[C2], vbMonday) > 5 Then
sem = 6
Else
sem = (Day(dat) + j1 - 2) \ 7 + 1
End If
sh.Tab.Color = Range("couleurs")(sem).Interior.Color
Else
sh.Tab.Color = Range("day").Interior.Color
End If
End If
End If
Next sh
End Sub
Cordialement.