Combo Box to search as you type after 3 characters

IntelligentCan1517

New Member
Joined
Jul 7, 2022
Messages
2
Office Version
  1. 2010
Platform
  1. Windows
Hello,

Can anyone help me with making combo box search dynamic? I have thousands of records that I feed in my combo box (one-dimensional array) and it appears all fine. I want to make the drop down list dynamic as user starts type in. The problem is the combo box change event takes too long as it is cycling through each item in the list and crashes down. What I want to achieve is leave the combo box blank until the user has typed 3 or 4 characters. By that time there should be less matches so it would be quick enough to work. Does anyone has some ideas or examples?

My attempt code is below: (I get an error Run time error 9)

Private Sub ComboBox1_Change()
Dim i As Long
For i = LBound(t_array) To UBound(t_array)
If Len(ComboBox1.Value) >= 4 Then
Me.ComboBox1.AddItem t_array(i)
End If
Next i
End Sub
 

Excel Facts

What is the shortcut key for Format Selection?
Ctrl+1 (the number one) will open the Format dialog for whatever is selected.

Forum statistics

Threads
1,224,823
Messages
6,181,181
Members
453,021
Latest member
Justyna P

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top