Public Sub ReloadClavier()
Dim X&, i&, A&, NB_JOURS&
If Cbmonth.Value = "" Or Cbyear.Value = "" Then Exit Sub
X = Weekday(DateSerial(Calendar.Cbyear, Calendar.Cbmonth.ListIndex + 1, 1), IIf(region = 0, vbSunday, vbMonday))
NB_JOURS = Day(DateSerial(Cbyear.Value, Cbmonth.ListIndex + 2, 0))
For i = 1 To 6: Me.Controls("sem" & i) = "": Next
For i = 1 To 42
With Calendar.Controls("j" & i)
.Caption = "": .Enabled = False: .BackColor = vbWhite: .ControlTipText = ""
If i >= X And A <= NB_JOURS - 1 Then
.Visible = True: A = A + 1: .Enabled = True: .Caption = A: .BackColor = &HE0E0E0
Controls(.Tag).Caption = DatePart("ww", DateSerial(Calendar.Cbyear.Value, Calendar.Cbmonth.ListIndex + 1, A), IIf(region = 0, vbSunday, vbMonday))
.BackColor = férié(i)
If i = 6 Or i = 7 Or i = 13 Or i = 14 Or i = 20 Or i = 21 Or i = 27 Or i = 28 Or i = 34 Or i = 35 Or i = 41 Or i = 42 Then
.Enabled = False: .BackColor = RGB(255, 200, 0)
End If
End If
End With
Next
End Sub