Private Sub ComboBox1_Change()
Dim deb As Date, fin As Date, tablo, i&, x, y$, n1&, n2&
TextBox1 = "": TextBox2 = ""
If Not IsDate(ComboBox1) Or Not IsDate(ComboBox2) Then Exit Sub
deb = Application.Min(CDate(ComboBox1), CDate(ComboBox2))
fin = Application.Max(CDate(ComboBox1), CDate(ComboBox2))
tablo = Feuil1.[A1].CurrentRegion.Resize(, 2) 'matrice, plus rapide
For i = 2 To UBound(tablo)
x = tablo(i, 1)
If x >= deb And x <= fin Then
y = LCase(tablo(i, 2))
If y = "p" Then n1 = n1 + 1
If y = "a" Then n2 = n2 + 1
End If
Next
TextBox1 = n1: TextBox2 = n2
End Sub
Private Sub ComboBox2_Change()
ComboBox1_Change
End Sub
Private Sub UserForm_Initialize()
With Feuil1.[A1].CurrentRegion.Resize(, 2)
If .Rows.Count > 1 Then ComboBox1.List = .Rows(2).Resize(.Rows.Count - 1).Value: _
ComboBox2.List = ComboBox1.List
End With
End Sub