I have worked to the reference code available at 'Previous Post Thanks a lot for the Code.
It works fine for search as you type. in Textbox1.
I request Codegurus and Codegenies to modify this so that by using two textboxes."From Date" and "To date". based on these two dates, the result of data in between the dates filter should be displayed on the listbox.
Textbox 2 and Textbox3 are dates, I want the dates in between to be displayed in the listbox1
[/CODE]
[/CODE]
It works fine for search as you type. in Textbox1.
I request Codegurus and Codegenies to modify this so that by using two textboxes."From Date" and "To date". based on these two dates, the result of data in between the dates filter should be displayed on the listbox.
Textbox 2 and Textbox3 are dates, I want the dates in between to be displayed in the listbox1
VBA Code:
Private Sub TextBox1_Change()
Dim i As Long, j As Long, k As Long
Dim tx As String
Dim vb, x
tx = Trim(UCase(TextBox1.Text))
Label1.Caption = ""
If tx = "" Then ListBox1.List = va: Exit Sub
x = Application.Match(ComboBox1.Value, Sheets(sList).Rows(1), 0)
If Not IsError(x) Then
tx = "*" & Replace((tx), " ", "*") & "*"
ReDim vb(1 To NOC, 1 To UBound(va, 1))
For i = 1 To UBound(va, 1)
If UCase(va(i, x)) Like tx Then
k = k + 1
For j = 1 To NOC
vb(j, k) = va(i, j)
Next
End If
Next
Select Case k
Case 0
ListBox1.Clear
Case 1
ReDim Preserve vb(1 To NOC, 1 To 15)
ListBox1.List = Application.Transpose(vb)
Case Is > 1
ReDim Preserve vb(1 To NOC, 1 To k)
ListBox1.List = Application.Transpose(vb)
End Select
Label1.Caption = "Found: " & k & " record"
End If
End Sub
[CODE=vba][CODE=vba]
[/CODE]