Private Sub CommandButton1_Click()
[COLOR=blue]agt = Me.ListBox1
[/COLOR]nb = 0
For n = 2 To Range("A65536").End(xlUp).Row
If (Range("B" & n) >= DTPicker1 And Range("B" & n) <= DTPicker2) Or (Range("B" & n) >= DTPicker1 And Range("B" & n) <= DTPicker2) [COLOR=blue]And Range("A" & n) = agt[/COLOR] Then
nb = nb + 1
End If
Next n
res = nb
End Sub