Sub reloadClavier() 'mise a jour du clavier
Dim Madate, i&, sem
If CBM.Value <> "" And CBA.Value <> "" Then
Madate = DateSerial(CBA.Value, CBM.ListIndex + 1, 1)
Madate = Madate - Weekday(Madate, vbUseSystemDayOfWeek)
For i = 1 To 6: Me.Controls("sem" & i) = "": Next
For i = 1 To 42
Madate = Madate + 1
sem = DatePart("ww", Madate, vbMonday, vbFirstFourDays)
With Me.Controls("j" & i)
.Enabled = False
.Caption = Day(Madate)
.ControlTipText = ""
If Month(Madate) =...
Private Sub Workbook_BeforeClose(Cancel As Boolean)
Application.CommandBars("cell").Reset
End Sub
Private Sub Workbook_Open()
With Application.CommandBars("cell")
.Reset
With .Controls.Add(msoControlButton, , , 1, True): .Caption = "calendrier": .OnAction = "ThisWorkbook.affiche": End With
End With
End Sub
Public Sub affiche(): CalendarX.Show 0: End Sub
Application.CommandBars("cell").Reset
Sub reloadClavier() 'mise a jour du clavier
Dim Madate, i&, sem
If CBM.Value <> "" And CBA.Value <> "" Then
Madate = DateSerial(CBA.Value, CBM.ListIndex + 1, 1)
Madate = Madate - Weekday(Madate, vbUseSystemDayOfWeek)
For i = 1 To 6: Me.Controls("sem" & i) = "": Next
For i = 1 To 42
Madate = Madate + 1
sem = DatePart("ww", Madate, vbMonday, vbFirstFourDays)
With Me.Controls("j" & i)
.Enabled = False
.Caption = Day(Madate)
.ControlTipText = ""
If Month(Madate) = CBM.ListIndex + 1 Then .Enabled = True: Me.Controls(.Tag) = sem
.BackColor = Array(&HC0C0C0, Array(vbWhite, vbYellow)(Abs(Madate = Date)))(Abs(Month(Madate) = CBM.ListIndex + 1))
If .Enabled Then
Select Case .Caption
Case 5: .BackColor = vbGreen: .ControlTipText = "ONSS"
Case 10: .BackColor = vbRed: .ControlTipText = "Pref Prof"
End Select
End If
End With
Next
End If
End Sub
Sub reloadClavier() 'mise a jour du clavier
Dim Madate, i&, sem
If CBM.Value <> "" And CBA.Value <> "" Then
Madate = DateSerial(CBA.Value, CBM.ListIndex + 1, 1)
Madate = Madate - Weekday(Madate, vbUseSystemDayOfWeek)
For i = 1 To 6: Me.Controls("sem" & i) = "": Next
For i = 1 To 42
Madate = Madate + 1
sem = DatePart("ww", Madate, vbMonday, vbFirstFourDays)
With Me.Controls("j" & i)
.Enabled = False
.Caption = Day(Madate)
.ControlTipText = ""
If Month(Madate) = CBM.ListIndex + 1 Then .Enabled = True: Me.Controls(.Tag) = sem
.BackColor = Array(&HC0C0C0, Array(vbWhite, vbYellow)(Abs(Madate = Date)))(Abs(Month(Madate) = CBM.ListIndex + 1))
If .Enabled Then
Select Case .Caption
Case 5: .BackColor = vbGreen: .ControlTipText = "ONSS"
'''Claudy
Label24.Caption = "ONSS: " & Format(DateSerial(CBA.Value, CBM.ListIndex + 1, 5), "dddd dd mmmm yyyy")
Case 10: .BackColor = vbGreen: .ControlTipText = "Prec Prof"
'''Claudy
Label25.Caption = "Prec Prof: " & Format(DateSerial(CBA.Value, CBM.ListIndex + 1, 10), "dddd dd mmmm yyyy")
End Select
End If
End With
Next
End If
End Sub