Results 1 to 13 of 13

Thread: VBA : SEARCHING problem

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1

    VBA : SEARCHING problem

    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?

    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
    Anyone can help or suggest?
    Attached Files Attached Files

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •