Akuini

Macro to create searchable data validation+combobox

Akuini

Well-known Member
Joined
Feb 1, 2016
Messages
5,275
Office Version
  1. 365
Platform
  1. Windows
Akuini submitted a new Excel article:

Macro to create searchable data validation+combobox - Speed up searching in long list data validation & easy to set various specific behaviors


Read more about this Excel article...
 

Excel Facts

Select a hidden cell
Somehide hide payroll data in column G? Press F5. Type G1. Enter. Look in formula bar while you arrow down through G.
Unfortunately, I think you are working on a later version of excel than I have. When I download the excel files, everything is stripped out (i.e. there's no code showing in VBA, no combo box, etc).
I think the downloaded file is corrupted. Sometimes when I download an xlsm file from Mediafire, it somehow change to .xlsx, especially if I download it via Firefox browser.
Try this link from dropbox:
 
I think the downloaded file is corrupted. Sometimes when I download an xlsm file from Mediafire, it somehow change to .xlsx, especially if I download it via Firefox browser.
Try this link from dropbox:
I actually just dumped the code you had in the thread and it started to work. Once I added it to my workbook, I got a Object variable or with block variable not set error '91' message in the following location highlighted in green. Any thoughts?

Sub get_filterY()
'search with keyword order
Dim x
Dim tx As String

d.RemoveAll
tx = UCase("*" & Replace((ComboBox1.Value), " ", "*") & "*")
For Each x In vList
If UCase(x) Like tx Then d(x) = Empty
Next

End Sub
 
Hm, that's strange, unless you have changed anything in the code actually the code will not read Sub get_filterY().
Try removing Sub get_filterY(), see what happens.
 
Hm, that's strange, unless you have changed anything in the code actually the code will not read Sub get_filterY().
Try removing Sub get_filterY(), see what happens.
I actually highlighted the wrong portion... It was the in the filterX() section.

Sub get_filterX()
'search without keyword order
Dim i As Long, x, z, q
Dim v As String
Dim flag As Boolean

d.RemoveAll
z = Split(UCase(ComboBox1.Value), " ")

For Each x In vList
flag = True: v = UCase(x)
For Each q In z
If InStr(1, v, q, vbBinaryCompare) = 0 Then flag = False: Exit For
Next
If flag = True Then d(x) = Empty
Next

End Sub
 
Not sure why that happens.
Could you download the example file from the new link?
There is a description on how to set up this seachable combobx.
 
Alright, I somehow got through the error message, but now I cannot get the Combo box to appear or read the validation list text.

 

Forum statistics

Threads
1,226,453
Messages
6,191,134
Members
453,642
Latest member
jefals

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