Consulting

Results 1 to 3 of 3

Thread: Search and Fill Listbox

  1. #1

    Search and Fill Listbox

    Hello,

    i was wondering how i can fill my listbox with 2 search criterias

    for example i like to search on 'In progress, Running'

    how can i do that?

    i use this code for searching

    Dim DataSH As Worksheet
    On Error GoTo errHandler:
    Me.ListBox1.RowSource = ""
      Set DataSH = Sheet10
       
    DataSH.Range("T9").Value = txtSearch.Text
    DataSH.Range("B8").CurrentRegion.AdvancedFilter Action:=xlFilterCopy, CriteriaRange:=DataSH.Range("T8:T9") _
    , CopyToRange:=DataSH.Range("V8:AM8")
    
    
    ListBox1.RowSource = DataSH.Range("outdata").Address(external:=True)
    Thank you

  2. #2
    Moderator VBAX Sage SamT's Avatar
    Joined
    Oct 2006
    Location
    Near Columbia
    Posts
    7,814
    Location
    "outdata" is undefined
    I expect the student to do their homework and find all the errrors I leeve in.


    Please take the time to read the Forum FAQ

  3. #3
    Knowledge Base Approver VBAX Wizard
    Joined
    Apr 2012
    Posts
    5,646
    Avoid rowsource.

    With sheet10
       .Range("T9")= txtSearch.Text
       .Range("B8").CurrentRegion.AdvancedFilter 2, .Range("T8:T9"), .Range("V8")
       ListBox1.List= .Range("V8).currentregion.value
    end with

Posting Permissions

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