kadrleyn
Member
In this template, I used Adodb.Connection and Adodb.Recordset to fill dates as unique into combo boxes and to sort dates oldest to newest .
The filtering results that created by selecting dates (first date-last date) from the combo boxes are listed in the listbox.
![77046 77046](https://chandoo.org/forum/data/attachments/77/77138-3aa7187fd5ec6894d65733a9a63db079.jpg)
Details & sample file link
The filtering results that created by selecting dates (first date-last date) from the combo boxes are listed in the listbox.
![77046 77046](https://chandoo.org/forum/data/attachments/77/77138-3aa7187fd5ec6894d65733a9a63db079.jpg)
Code:
For i = 2 To Sheets("Sheet1").Range("B" & Rows.Count).End(xlUp).Row
If CDate(Cells(i, "B").Value) >= CDate(ComboBox1.Value) And CDate(Cells(i, "B").Value) <= CDate(ComboBox2.Value) Then
With ListBox1
.AddItem Cells(i, 1).Value
.List(.ListCount - 1, 1) = Format(Cells(i, 2).Value, "dd.mm.yyyy")
.List(.ListCount - 1, 2) = Cells(i, 3).Value
.List(.ListCount - 1, 3) = Cells(i, 4).Value
.List(.ListCount - 1, 4) = Cells(i, 5).Value
.List(.ListCount - 1, 5) = Cells(i, 6).Value
.List(.ListCount - 1, 6) = Format(Cells(i, 7).Value, "#,##0.00")
.List(.ListCount - 1, 7) = Format(Cells(i, 8).Value, "#,##0.00")
End With
End If
Next i
Details & sample file link