I created an Excel add-in called “Search deList”, to create searchable data validation

Akuini

Well-known Member
Joined
Feb 1, 2016
Messages
5,001
Office Version
  1. 365
Platform
  1. Windows
I created an add-in called “Search deList”, and I share it as a freeware.
Its function is to speed up searching in data validation list. In any cell that has data validation (with List type) pressing ALT+RIGHT will open a Userform with a combobox. You can type multiple keywords (separated by a space) in the combobox and the list will be narrowed down as you type.
I’d be appreciate if anyone can test this add-in to find any bugs or just suggesting ideas to improve its functionality.
Also, the code is not protected by password, so if anyone needs to change or add specific feature or behavior then feel free to amend the code, and if you need help for that I’ll help if I can.

How it works:
  • In any cell that has data validation (with List type) pressing ALT+RIGHT will open a Userform with a combobox.
  • Type some keywords to search, separated by a space, e.g "ma la"
  • The list will be narrowed down as you type.
  • The search ignores the keywords order, so the keyword "ma la" would match "Maryland" and "Alabama".
  • You can use up-down arrow to select an item, then hit ENTER, the selected item will be inserted into the cell, and the userform will be closed.
  • You can also use single-click to select an item, then DOUBLE-CLICK inside the box, the selected item will be inserted into the cell, and the userform will be closed.
  • To leave the combobox without inserting its value to the activecell: hit TAB or ESC
  • Numeric values in the list will be treated as text.
  • In the Status Bar you can see how many unique items are found & displayed.
  • You don't need VBA (except if you want to use additional feature as I explain below), so you can save your workbook as .xlsx.
Additional feature :
If you want, you can also activate the userform by double-clicking a cell, but you need VBA to do that. Here’s how:
Copy-paste this code into Thisworkbook code window of your workbook:
VBA Code:
Private Sub Workbook_SheetBeforeDoubleClick(ByVal Sh As Object, ByVal Target As Range, Cancel As Boolean)
If TypeName(Selection) = "Range" Then
    Dim v
    On Error Resume Next
        v = ActiveCell.Validation.Type
    On Error GoTo 0
    'if activecell has data validation type 3
    'run "Search deList" add-in by doubke-clicking a cell
    If v = 3 Then Cancel = True: Application.Run ("toShow__dheeDAV")
End If
End Sub
Now, in every sheet, double-clicking any cell that has data validation (with List type) will open the Userform.

Image:

image Search deList.jpg


How to use it:
  1. Install the add-in. This article explains how to install an add-in: How to install or uninstall an Excel Add-in - Excel Off The Grid
  2. Open any workbook that has data validation (with list type).
  3. In any cell that has data validation, pressing ALT+RIGHT will open a Userform with a combobox.
  4. Play with it & see how it works.
NOTES:
  • This add-in also works on dependent data validation.
  • It works on large list (I tested it on 100K rows of data).
  • One caveat of using macro is when macro changes/writes something on sheet it will delete Undo Stack, so at that time you can't use UNDO. In this case it happens every time the combobox value is inserted into the active cell.

Search_deList_v1 add-in:
Search_deList_v1

=========================================================================================

Update, 2022-Nov-18:
Search deList v.2.1 + manual.zip, it works on Excel 2007 or later:

Search deList v.365.1 + manual.zip, it works on Excel 365 or later

This new version has some additional features, some of them:
Several ways to search, like using AND or OR or LIKE operator , with or without keyword order.
Sort the list by original order or ascending order.
Widen or shorten the combobox width at run time.
Insert multiple entries into the cell.

=======================================================================================

Regards,
Akuini
 
Last edited by a moderator:
@Akuini

I am sorry it didn't work for you ... I really don't know the reason ... I hope I haven't wasted your time.

It worked for me as you can see in the clip below: (UNDO STACK preserved)




I have included an additional ESC keystroke at the end in the SendInput array so I have settled for the following final SendSringAPI routine:

VBA Code:
'Routine to Copy ComBoBox Value to ClipBoard and send CTRL + V
Sub SendSringAPI(ByVal sText As String)

    Const KEYEVENTF_KEYUP = &H2, KEYEVENTF_UNICODE = &H4, VK_CONTROL = &H11, VK_ESCAPE = &H1B

    Dim oDataObj As DataObject
    Dim i As Long

    If Len(sText) Then

       Set oDataObj = New DataObject
       oDataObj.SetText sText
       oDataObj.PutInClipboard

       ReDim InputArray(6&) As tagINPUT_keybd

       InputArray(0&).INPUTTYPE = 1&
       InputArray(0&).ki.wVk = VK_CONTROL
       InputArray(0&).ki.dwFlags = KEYEVENTF_UNICODE

       InputArray(1&).INPUTTYPE = 1&
       InputArray(1&).ki.wVk = AscW("V")
       InputArray(1&).ki.dwFlags = KEYEVENTF_UNICODE

       InputArray(2&).INPUTTYPE = 1&
       InputArray(2&).ki.wVk = VK_CONTROL
       InputArray(2&).ki.dwFlags = KEYEVENTF_UNICODE + KEYEVENTF_KEYUP

       InputArray(3&).INPUTTYPE = 1&
       InputArray(3&).ki.wVk = AscW("V")
       InputArray(3&).ki.dwFlags = KEYEVENTF_UNICODE + KEYEVENTF_KEYUP
     
       InputArray(4).INPUTTYPE = 1&
       InputArray(4).ki.wVk = VK_ESCAPE
       InputArray(4).ki.dwFlags = KEYEVENTF_UNICODE
 
       InputArray(5).INPUTTYPE = 1&
       InputArray(5).ki.wVk = VK_ESCAPE
       InputArray(5).ki.dwFlags = KEYEVENTF_UNICODE + KEYEVENTF_KEYUP

       Call SendInput(6&, InputArray(0&), LenB(InputArray(0&)))
     
    End If

End Sub

Regards.
 
Upvote 0

Excel Facts

Add Bullets to Range
Select range. Press Ctrl+1. On Number tab, choose Custom. Type Alt+7 then space then @ sign (using 7 on numeric keypad)
I am sorry it didn't work for you ... I really don't know the reason ... I hope I haven't wasted your time.
Not at all, I like to learn something new. If you have a chance to try it on Excel-32 bit you probably can resolve the issue. I'd like to hear about that.
Thank you. (y)
 
Upvote 0
@Akuini

I have been working for a charity cataloguing thousands of items, with multiple dropdown spreadsheets, for over 2 years. I am not a very pro excel user, and have searched for hours for ways to make the work faster. I just found your add-in and it exactly what i have been looking for.
Thanks so much may god bless you

One question you say there is an option for multiple choicce by pressing F9. I am not able to get this to work and when i type F9 i get an error message - wrong input?

Once again thanks
 
Upvote 0
@Akuini

I have been working for a charity cataloguing thousands of items, with multiple dropdown spreadsheets, for over 2 years. I am not a very pro excel user, and have searched for hours for ways to make the work faster. I just found your add-in and it exactly what i have been looking for.
Thanks so much may god bless you

One question you say there is an option for multiple choicce by pressing F9. I am not able to get this to work and when i type F9 i get an error message - wrong input?

Once again thanks
You need to select an item from the list (by using down-up arrow) then press F9 key (not by typing "F9"), the item will be sent to the active cell, then you can select different item & press F9 again, as many as needed, then finish with pressing Escape instead of Enter.
 
Upvote 0
You need to select an item from the list (by using down-up arrow) then press F9 key (not by typing "F9"), the item will be sent to the active cell, then you can select different item & press F9 again, as many as needed, then finish with pressing Escape instead of Enter.
It worked. Thanks so much for your help.
 
Upvote 0
Hi
I dont want to drive you mad, however is there a way to use your add in on a drop list in a user form?, and if not is it possible to do something similar?
thanks in advance
 
Upvote 0
however is there a way to use your add in on a drop list in a user form?,
No.
But I have an example of a searchable combobox in userform.
How big is your data? more than 10K rows?
 
Upvote 0
not yet that big. [it currently stands at around 3000. [it may get there though]. By the way the combo box source data includes many doubles, would ur example show the double or not?

Thanks so much for your ever so timely response!
 
Upvote 0
not yet that big. [it currently stands at around 3000. [it may get there though]. By the way the combo box source data includes many doubles, would ur example show the double or not?

Thanks so much for your ever so timely response!
Could you upload a sample workbook (without sensitive data) to a sharing site like dropbox.com or google drive? And then share the link here.
And please explain what you're trying to do in more detail.
 
Upvote 0

Forum statistics

Threads
1,215,580
Messages
6,125,654
Members
449,245
Latest member
PatrickL

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