when Adding from and to the text box to the code not work
this line
And CDate(Worksheets("Database").Cells(i, "B").Value) >= CDate(Me.txtFrom.Value) And CDate(Worksheets("Database").Cells(i, "B").Value) <= CDate(Me.txtTo.Value) Then
this line
And CDate(Worksheets("Database").Cells(i, "B").Value) >= CDate(Me.txtFrom.Value) And CDate(Worksheets("Database").Cells(i, "B").Value) <= CDate(Me.txtTo.Value) Then
Code:
On Error Resume Next
listSearch.clear
If txtSearchABBACCT.Value = "" Then
End If
Worksheets("Database").Activate
Dim LastRow As Integer
LastRow = Worksheets("Database").Cells(Rows.Count, 2).End(xlUp).Row
Dim i As Integer
i = 0
For Each C In Worksheets("Database").Range("D2:D" & LastRow)
If UCase(C.Value) & "" Like "*" & UCase(txtSearchABBACCT.Value) & "*" And CDate(Worksheets("Database").Cells(i, "B").Value) >= CDate(Me.txtFrom.Value) And CDate(Worksheets("Database").Cells(i, "B").Value) <= CDate(Me.txtTo.Value) Then
listSearch.AddItem
listSearch.List(i, 0) = C.Row
listSearch.List(i, 1) = Worksheets("Database").Cells(C.Row, 3).Value
listSearch.List(i, 2) = Worksheets("Database").Cells(C.Row, 4).Value
i = i + 1
End If
Next C