I want to create userform for searching between two IDS. For example If I put 150002(combobox3) and 150006(combobox4) then ID: 150002,150003,150004,150005,150006 will be showed in lisbox when searching.
'Case 5/3
'ID1<ID2
I try to use this code but it is not working?
Anyone can help or suggest?If ComboBox1.Value = "" And ComboBox2.Value = "" And ComboBox3.Value < ComboBox4.Value Then For sat = 2 To Sheets("Sheet1").Cells(10000, "a").End(xlUp).Row If s >= (ComboBox3.Value - 150000) And s <= (ComboBox4.Value - 150000) Then ListBox1.AddItem ListBox1.List(s, 0) = Sheets("Sheet1").Cells(sat, "A") ListBox1.List(s, 1) = Sheets("Sheet1").Cells(sat, "B") ListBox1.List(s, 2) = Sheets("Sheet1").Cells(sat, "C") ListBox1.List(s, 3) = Sheets("Sheet1").Cells(sat, "D") ListBox1.List(s, 4) = Sheets("Sheet1").Cells(sat, "E") ListBox1.List(s, 5) = Sheets("Sheet1").Cells(sat, "F") ListBox1.List(s, 6) = Sheets("Sheet1").Cells(sat, "G") ListBox1.List(s, 7) = Sheets("Sheet1").Cells(sat, "H") ListBox1.List(s, 8) = Sheets("Sheet1").Cells(sat, "I") s = s + 1 End If: Next End If




Reply With Quote