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
| Private Sub UserForm_Initialize()
Dim i As Long
Dim bClient As Boolean, bRdv As Boolean
Me.TxtAnniv.Visible = False
Me.ListNomsAnniv.Visible = False
Me.ListDatesAnniv.Visible = False
Me.LabelRDV.Visible = False
Me.ListRDV.Visible = False
For i = 5000 To 2 Step -1
If Worksheets("CLIENTS").Cells(i, 10) = Date - 7 Then
Me.ListNomsAnniv.AddItem Worksheets("CLIENTS").Cells(i, 5).Value
Me.ListDatesAnniv.AddItem Worksheets("CLIENTS").Cells(i, 10).Value
End If
If Worksheets("RDV").Cells(i, 1) = Date Then Me.ListRDV.AddItem Worksheets("RDV").Cells(i, 2).Value
Next i
'Affiche les textbox et listbox si la date est reconnue et les remplis
If Me.ListNomsAnniv.ListCount > 0 Then
Me.TxtAnniv.Visible = True
Me.ListNomsAnniv.Visible = True
Me.ListDatesAnniv.Visible = True
End If
If ListRDV.ListCount > 0 Then
Me.LabelRDV.Visible = True
Me.ListRDV.Visible = True
End If
End Sub |
Partager