Bonsoir,
Dans le code ci-dessous j'ai intégrer DTpicker à un userform.
Suivant la date choisi avec DTpicker, des label inscrivent des données.
Seulement cela ne fonctionne que sur un changement dans Dtpicker.
Après si je change de date les label n'affiche pas les nouvelles données
Private Sub BTN_fermer_Click()
Unload Me
End Sub
Private Sub DTPicker1_change()
Sheets(MonthName(Month(DTPicker1))).Activate
End Sub
Private Sub UserForm_Initialize()
Dim Colo As Long
Dim date1 As String
Dim data1 As String
Dim jour As Integer
Dim date2 As Date
Dim date3 As Date
Dim date4 As Date
Dim trouve As Boolean
Dim cellule As Range
Dim nomfeuille1 As String
Dim col1 As String
Dim lidep1 As Long
Dim Lifin As Long
With Sheets(MonthName(Month(DTPicker1)))
Colo = Day(DTPicker1) * 2 + 1
date1 = Format(Now, "dddd d mmm yyyy")
jour = Weekday(DTPicker1)
FR_picker1.Caption = "vous avez selectionné le , " & Format(DTPicker1, "dddd d mmm yyyy") & " , les effectifs sont : "
EOGjour.Caption = "EOG SPP Jour : " & .Cells(77, Colo).Value - 1
EOGnuit.Caption = "EOG SPP Nuit : " & .Cells(77, Colo + 1).Value - 1
FR_picker2.Caption = "effectif semaine"
normal1.Caption = " 13 SPP de Jour"
normal2.Caption = " 11 SPP de Nuit"
If Cells(77, Colo).Value < 13 Or Cells(77, Colo + 1) < 11 Then
IMG_attention2.Picture = LoadPicture(ThisWorkbook.Path & "\attention.jpg")
lbl1.Caption = "Demain, nous sommes en effectif semaine "
lbl2.Caption = "L'effectif de jour doit être de ( chef de garde compris) : " & 13
lbl3.Caption = "L'effectif de nuit doit être de ( chef de garde compris) : " & 11
End If
End With
End Sub
Dans le code ci-dessous j'ai intégrer DTpicker à un userform.
Suivant la date choisi avec DTpicker, des label inscrivent des données.
Seulement cela ne fonctionne que sur un changement dans Dtpicker.
Après si je change de date les label n'affiche pas les nouvelles données
Private Sub BTN_fermer_Click()
Unload Me
End Sub
Private Sub DTPicker1_change()
Sheets(MonthName(Month(DTPicker1))).Activate
End Sub
Private Sub UserForm_Initialize()
Dim Colo As Long
Dim date1 As String
Dim data1 As String
Dim jour As Integer
Dim date2 As Date
Dim date3 As Date
Dim date4 As Date
Dim trouve As Boolean
Dim cellule As Range
Dim nomfeuille1 As String
Dim col1 As String
Dim lidep1 As Long
Dim Lifin As Long
With Sheets(MonthName(Month(DTPicker1)))
Colo = Day(DTPicker1) * 2 + 1
date1 = Format(Now, "dddd d mmm yyyy")
jour = Weekday(DTPicker1)
FR_picker1.Caption = "vous avez selectionné le , " & Format(DTPicker1, "dddd d mmm yyyy") & " , les effectifs sont : "
EOGjour.Caption = "EOG SPP Jour : " & .Cells(77, Colo).Value - 1
EOGnuit.Caption = "EOG SPP Nuit : " & .Cells(77, Colo + 1).Value - 1
FR_picker2.Caption = "effectif semaine"
normal1.Caption = " 13 SPP de Jour"
normal2.Caption = " 11 SPP de Nuit"
If Cells(77, Colo).Value < 13 Or Cells(77, Colo + 1) < 11 Then
IMG_attention2.Picture = LoadPicture(ThisWorkbook.Path & "\attention.jpg")
lbl1.Caption = "Demain, nous sommes en effectif semaine "
lbl2.Caption = "L'effectif de jour doit être de ( chef de garde compris) : " & 13
lbl3.Caption = "L'effectif de nuit doit être de ( chef de garde compris) : " & 11
End If
End With
End Sub