1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
|
Sub affiche_jour_creneaux_seance()
Dim Tbl()
Set F = Sheets(Groupes)
BD = F.Range("A7:Q" & F.[A65000].End(xlUp).Row).Value
Ncol = UBound(BD, 2)
dte = Me.cbx_jour_planifiée
creneaux = Me.cbx_creneaux_horaires
seance = Me.cbx_seance
n = 0
For i = 1 To UBound(BD)
If BD(i, 5) Like dte And BD(i, 7) Like creneaux And BD(i, 4) Like seance And BD(i, 6) >= CDate(Date) And IsEmpty(BD(i, 10)) Then
n = n + 1: ReDim Preserve Tbl(1 To Ncol, 1 To n)
For K = 1 To Ncol: Tbl(K, n) = BD(i, K): Next K
End If
Next i
If n > 0 Then
Me.lst_RDV.Column = Tbl
Me.lbl_RDV_dispo.Caption = "Vous avez " & Me.lst_RDV.ListCount & " RDV disponible(s) pour ce jour/creneau/date"
Me.lbl_RDV_dispo.BackColor = RGB(0, 255, 0)
Else
Me.lst_RDV.Clear
Me.lbl_RDV_dispo.Caption = "il n'y a plus de RDV disponible, Veuillez modifier votre choix"
Me.lbl_RDV_dispo.BackColor = RGB(255, 0, 0)
End If
End Sub |
Partager