Results 1 to 8 of 8

Populate a ComboBox

Threaded View

zplugger Populate a ComboBox 09-21-2012, 08:15 AM
john55 Re: Populate a ComboBox 09-21-2012, 08:44 AM
zplugger Re: Populate a ComboBox 09-21-2012, 09:12 AM
cplmckenzie Re: Populate a ComboBox 09-21-2012, 07:14 PM
cplmckenzie Re: Populate a ComboBox 09-21-2012, 07:05 PM
zplugger Re: Populate a ComboBox 09-21-2012, 07:10 PM
zplugger Re: Populate a ComboBox 09-22-2012, 12:27 PM
zplugger Re: Populate a ComboBox 09-25-2012, 12:19 PM
  1. #1
    Forum Contributor
    Join Date
    03-05-2009
    Location
    usa
    MS-Off Ver
    Excel 2016 32Bit
    Posts
    1,173

    Populate a ComboBox

    Trying to change a textbox over to a combobox,thetextbox does a data search to find a name. I hope
    a combobox would populate with more of the same names then narrow down to one. So if there was
    six Jims it would show all until last name is typed in. Here is the code for the textbox all I changed was the textbox to combobox. Not
    sure how to populate the comboBox? Attached is a workbook of what I would like to do.
    Z

    Private Sub ComboBox1_Change()
     Dim arrList As Variant
        
        With Me.ListBox2
            .ListFillRange = vbNullString
            .Clear
                
            If Range("AB2").Value = True Then
                'Search by Actor
                arrList = Filter(Application.Transpose(Evaluate("if(isnumber(search(""" & Me.ComboBox1.Text & """,list_actors)),list_movies)")), False, False)
            Else
                'Search by Movie
                arrList = Filter(Application.Transpose([list_movies].Value), Me.ComboBox1.Text, True, vbTextCompare)
            End If
            
            If IsArray(arrList) Then
                .List = arrList
            Else
                If InStr(1, arrList, Me.ComboBox1.Text, vbTextCompare) Then .AddItem arrList
            End If
        End With
        
        If IsArray(arrList) Then Erase arrList
        If ListBox2.ListCount <> 0 Then
            ListBox2.Selected(o) = True
        Else
            Range("J9").ClearContents
        End If
        
    End Sub
    Attached Files Attached Files
    Last edited by zplugger; 09-25-2012 at 12:20 PM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1