Thanks you very much for suggestion from SamT and Aussiebear.
I change condition from "If .....then" to "If not......then"
It is now working.Dim a, b As Long Dim sCrit As String Dim tCrit, uCrit As Long Dim vCrit, wCrit As String Dim lbtarget As MSForms.ListBox Dim rngSource As Range Set rngSource = Worksheets("Sheet2").Range("A2:I1000") tCrit = ComboBox3.Value With Me.ListBox1 .ColumnCount = 9 .ColumnWidths = "80;80;80;0;0;110;80;0;30" .List = rngSource.Cells.Value For a = .ListCount - 1 To 0 Step -1 If Not UCase(.List(a, 0)) >= tCrit Then .RemoveItem a End If Next a End With uCrit = ComboBox4.Value With Me.ListBox1 For a = .ListCount - 1 To 0 Step -1 If Not UCase(.List(a, 0)) <= uCrit Then .RemoveItem a End If Next a End With
And I will code to find dates between two dates ( start and end date) .
Anyone can suggest or give some example?




Reply With Quote