Option Explicit
Private Sub cmdOK_Click()
If Date1 = "" Or Date2 = "" Then Exit Sub
If Not IsDate(Date1) Or Not IsDate(Date2) Then Exit Sub
Dim D1 As Date, D2 As Date, D3 As Date, D4 As Date
Dim chn$, n%, dlg&, lig&
D1 = DateValue(Date1): D2 = DateValue(Date2)
With Worksheets("Feuil1")
dlg = .Cells(Rows.Count, 1).End(3).Row: If dlg < 3 Then Exit Sub
For lig = 3 To dlg
With .Cells(lig, 1)
If Not IsEmpty(.Offset(, 1)) And Not IsEmpty(.Offset(, 2)) Then
If IsDate(.Offset(, 1)) And IsDate(.Offset(, 2)) Then
D3 = .Offset(, 1): D4 = .Offset(, 2)
If D3 >= D1 And D4 <= D2 Then
If cbNom = "" Or (cbNom <> "" And cbNom = .Value) Then
chn = chn & D3 & " " & D4 & " " & .Value & vbLf
n = n + 1
End If
End If
End If
End If
End With
Next lig
lbResult = chn: lbNb = n
End With
End Sub
Private Sub Date1_KeyPress(ByVal KeyAscii As MSForms.ReturnInteger)
If KeyAscii = 27 Then Unload Me
End Sub
Private Sub Date2_KeyPress(ByVal KeyAscii As MSForms.ReturnInteger)
If KeyAscii = 27 Then Unload Me
End Sub
Private Sub cbNom_KeyPress(ByVal KeyAscii As MSForms.ReturnInteger)
If KeyAscii = 27 Then Unload Me
End Sub
Private Sub cmdClose_Click()
Unload Me
End Sub
Private Sub UserForm_Initialize()
Dim n&
n = Feuil4.Cells(Rows.Count, 1).End(3).Row: If n = 1 Then Exit Sub
cbNom.RowSource = "Feuil4!A2:A" & n
End Sub