Quantcast
Channel: Excel Help Forum - Excel Programming / VBA / Macros
Viewing all articles
Browse latest Browse all 50085

[SOLVED] Combobox list for two columns or match two different column ranges

$
0
0
I have tried looking this up but all I get is two columns within the the combobox. What I want is for vba to search two columns and suggest cell contents from both without taking a long time. I have tried looking into arrays but that is way above my knowledge level when I tried to read it.

Namecb is my combobox

Right now I have this in Namecb_Change(), but it is terribly slow:
Code:

    Sen = Application.Match(Namecb.Value, ws1.Columns(1), 0)
    If IsError(Sen) Then
        Me.Namecb.List = Worksheets("Total Guests").Range("B:B").Value
    Else
        Me.Namecb.List = Worksheets("Total Guests").Range("A:A").Value
    End If

This is in my initialize:
Code:

Public Sub UserForm_initialize()
Me.Namecb.List = Worksheets("Total Guests").Range("A:A").Value

Is there a way to make this run faster or another way to do it?

Viewing all articles
Browse latest Browse all 50085

Trending Articles