Sub Calendrier()
Dim X&, i&, cal As Range, cell As Range
'le petit plus
ANNEE = InputBox("Choisir l'année du calendrier?", "Calendrier", Year(Date))
FD = CDate("1/12/" & ANNEE - 1): [G16] = FD: [G16:T16].DataSeries 1, 3, 3, 1
For i = 1 To 14
X = Day(DateSerial(Year(Cells(16, i + 6)), Month(Cells(16, i + 6)) + 1, 0))
Cells(16, i + 6).Resize(X).DataSeries 2, 3, 1, 1
Next
Range("G16:T47").FormatConditions.Add Type:=xlExpression, Formula1:="=ET(JOURSEM(G16;2)>5;G16<>"""")"
Range("G16:T47").FormatConditions(Selection.FormatConditions.Count).SetFirstPriority
With Range("G16:T47").FormatConditions(1).Interior
.PatternColorIndex = xlAutomatic
.ThemeColor = xlThemeColorDark1
.TintAndShade = -0.14996795556505
End With
Range("G16:T47").FormatConditions(1).StopIfTrue = False
Range("G16:T47").Borders.LineStyle = 1
End Sub