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 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89
|
Private Sub UserForm_Initialize()
'code de jcDSoft
Dim x As Integer
With ListBox1
For x = 1 To 31
.AddItem x
Next
End With
With ListBox2
For x = 1 To 12
.AddItem MonthName(x)
Next
.ListIndex = 0
End With
With ListBox3
For x = Year(Now) To Year(Now) - 100 Step -1
.AddItem x
Next
.ListIndex = 0
End With
End Sub
Private Sub ListBox1_Click()
Dim Mois As Integer
Dim I As Integer
With ListBox2
.Clear
For I = 1 To 12
On Error Resume Next
Mois = Day(CDate(Format(ListBox1.List(ListBox1.ListIndex), "00") & "/" & _
Format(I, "00") & "/" & ListBox3.List(ListBox3.ListIndex)))
If Err.Number = 0 Then ListBox2.AddItem MonthName(I)
Next I
End With
End Sub
Private Sub ListBox2_Click()
Dim Jour As Integer
Dim I As Integer
With ListBox1
.Clear
For I = 1 To 31
On Error Resume Next
Jour = Month(CDate(Format(I, "00") & "/" & Format(ListBox2.List(ListBox2.ListIndex), "00") _
& "/" & ListBox3.List(ListBox3.ListIndex)))
If Err.Number = 0 Then ListBox1.AddItem I
Next I
End With
End Sub
Private Sub ListBox3_Click()
ListBox2_Click
End Sub |
Partager