You are on page 1of 19

6/1/2016 Create an Excel Drop Down List with Search Suggestions

Download FREE Ebook - 51 Tips to Excel The Smart Way ×


Your Email... DOWNLOAD

VBA Tips Formula Hacks Charting Excel Courses Free Templates

Create an Excel Drop Down list with Sea

We all use Google as a part of our daily routine. One of its features is search suggestion
Google acts smart and gives us a list of suggestions while we are typing.

In this tutorial, you’ll learn how to create an excel drop down list that has this search
suggestion feature – i.e., it shows a drop down list of the matching items as you type.

Excel Drop Down list with Search Suggestion

For the purpose of this tutorial, I am using the data of Top 20 countries by GDP. The int
to create an excel drop down list with search suggestion mechanism, such that it shows

http://trumpexcel.com/2013/10/excel-drop-down-list-with-search-suggestions/ 1/19
6/1/2016 Create an Excel Drop Down List with Search Suggestions

down with the matching options as I type in the search bar.

Something as shown below:

To follow along, download the file from here

Creating the excel drop down list with search suggestion would be a three-part process:

1. Configuring the search box.

2. Setting the Data.

3. Writing a short VBA Code to make it work.

http://trumpexcel.com/2013/10/excel-drop-down-list-with-search-suggestions/ 2/19
6/1/2016 Create an Excel Drop Down List with Search Suggestions

Step 1 – Configuring the Search Box

In this first step, I will use a combo-box and configure it so that when you type in it, th
also reflected in a cell in real time.

Here are the steps to do this:

1. Go to Developer Tab –> Insert –> ActiveX Controls –> Combo Box (ActiveX Control).

 There is a possibility you may not find the developer tab in the ribbon. By de
is hidden and needs to be enabled. Click here to know how to get the develope
the ribbon in Excel.

2. Move your cursor to the worksheet area and click anywhere. It will insert a combo box

3. Right-click on the Combo Box and select Properties.

http://trumpexcel.com/2013/10/excel-drop-down-list-with-search-suggestions/ 3/19
6/1/2016 Create an Excel Drop Down List with Search Suggestions

4. In the properties dialogue box, make the following changes:

 AutoWordSelect: False

 LinkedCell: B3

 ListFillRange: DropDownList (we will create a named range with this name i
2)

 MatchEntry: 2 – fmMatchEntryNone

http://trumpexcel.com/2013/10/excel-drop-down-list-with-search-suggestions/ 4/19
6/1/2016 Create an Excel Drop Down List with Search Suggestions

(Cell B3 is linked to the Combo Box, which means that anything you type in the Combo
entered in B3)

4. Go to Developer tab and click on Design Mode. This will enable you to enter text in th
Combo Box. Also, since cell B3 is linked to the combo box, any text that you enter in
combo box would also be reflected in B3 in real-time.

Step 2 – Setting the Data

Now that the search box is all set, we need to get the data in place. The idea is that as
as you type anything in the search box, it shows only those items that have that text in

To do this, we will use

 Three helper columns.

http://trumpexcel.com/2013/10/excel-drop-down-list-with-search-suggestions/ 5/19
6/1/2016 Create an Excel Drop Down List with Search Suggestions

 One dynamic named range.

Helper Column 1

Put the following formula in cell F3 and drag it for the entire column (F3:F22)

=--ISNUMBER(IFERROR(SEARCH($B$3,E3,1),""))

This formula returns 1 when the text in the Combo Box is there in the name of the coun
the left. For example, if you type UNI, then only the values for United States and Uni
Kingdom are 1 and all the remaining values are 0.

Helper Column 2

Put the following formula in Cell G3 and drag it for the entire column (G3:G22)

=IF(F3=1,COUNTIF($F$3:F3,1),"")

This formula returns 1 for the first occurrence where Combo Box text matches the count
http://trumpexcel.com/2013/10/excel-drop-down-list-with-search-suggestions/ 6/19
6/1/2016 Create an Excel Drop Down List with Search Suggestions

name, 2 for the second occurrence, 3 for the third and so on. For example, if you type
cell will display 1 as it matches United States, and G9 will display 2 as it matches Unite
Kingdom. The rest of the cells will be blank.

Helper Column 3

Put the following formula in cell H3 and drag it for the entire column (H3:H22)

=IFERROR(INDEX($E$3:$E$22,MATCH(ROWS($G$3:G3),$G$3:$G$22,0)),"")

This formula stacks all the matching names together without any blank cells in between
For example, if you type UNI, this column would show 2 and 9 together, and rest all cel
be blank.

http://trumpexcel.com/2013/10/excel-drop-down-list-with-search-suggestions/ 7/19
6/1/2016 Create an Excel Drop Down List with Search Suggestions

Creating the Dynamic Named Range

Now that the helper columns are in place, we need to create the dynamic named range.
named range will only refer to those values that match the text entered in the combo bo
will use this dynamic named range to show the values in the drop-down box.

Note: In step 1 we entered DropDownList in the ListFillRange option. Now we will creat
named range with the same name.

Here are the steps to create it:

1. Go to Formulas –> Name Manager.

2. In the name manager dialogue box click New. It will open a New Name dialogue box.

3. In the Name Field enter DropDownList

4. In the Refers to Field enter the formula: =$H$3:INDEX($H$3:$H$22,MAX($G$3:$G$2

Step 3 – Putting the VBA Code to Work

We are almost there.

http://trumpexcel.com/2013/10/excel-drop-down-list-with-search-suggestions/ 8/19
6/1/2016 Create an Excel Drop Down List with Search Suggestions

The final part is to write a short VBA code. This code make the drop down dynamic such
shows the matching items/names as you are typing in the search box.

To add this code to your workbook:

1. Right click on the Worksheet tab and select View Code.

2. In the VBA window, Copy and Paste the following code:

Private Sub ComboBox1_Change()


ComboBox1.ListFillRange = "DropDownList"
Me.ComboBox1.DropDown
End Sub

That’s it!!

You are all set with your own Google type Search bar for a drop-down.

For a better look and feel, you can cover cell B3 with the Combo Box and hide all the he
columns. You can now show off a little with this amazing Excel trick.

To follow along, download the file from here

http://trumpexcel.com/2013/10/excel-drop-down-list-with-search-suggestions/ 9/19
6/1/2016 Create an Excel Drop Down List with Search Suggestions

How to create a Dynamic Search Suggestion Drop Down List ...

Excel Functions Used –> IFERROR | SEARCH | COUNTIF | IF | INDEX | MATCH | ROWS

What do you think? Would you be able to use this search suggestion drop-down list in y
work? Let me know your thoughts by leaving a comment.

If you have enjoyed this tutorial, I am sure you would like these too:

 Dynamic Search – Highlights matching data as you type.

 Dynamic Filter – Extract matching data while you type.

 Extract Data based on a Drop Down list selection.

 Creating Dependent Drop Down Lists in Excel.

 Creating a Drop Down List in Excel.

DOWNLOAD FREE EXCEL EBOO


51 Excel Tips to Save Time & Increase Productivity


Enthusiasts ​
(12,000+​ h ave ​
A lready Downloaded)

Email SEND IT TO ME!


http://trumpexcel.com/2013/10/excel-drop-down-list-with-search-suggestions/ 10/19
6/1/2016 Create an Excel Drop Down List with Search Suggestions

 Sumit Bansal  Excel Tips, VBA Tips  Dashb

215 Comments Trump Excel

 Recommend 9 ⤤ Share

Join the discussion…

Eka • 2 years ago


Thank you very much from indonesia for this amazing trick =)
△ ▽ • Reply • Share ›

Sumit Bansal Mod > Eka • 2 years ago


Thanks Eka :)
△ ▽ • Reply • Share ›

Jesus MIranda • 2 years ago


how can i do That in VBA
1△ ▽ • Reply • Share ›

Sumit Bansal Mod > Jesus MIranda • 2 years ago


Hi Jesus Miranda.. I am sure there is a way to do this all using VBA, but I have explored that muc
definitely share when I come up with the VBA method
1△ ▽ • Reply • Share ›

Rasmus Plats > Sumit Bansal • 2 years ago


Any update on a VBA method?
I have 4 columns that one dropdown needs to handle (one at a time) and the columns nee
filtered as it dont contrain unique data + length of list can change
△ ▽ • Reply • Share ›
http://trumpexcel.com/2013/10/excel-drop-down-list-with-search-suggestions/ 11/19
6/1/2016 Create an Excel Drop Down List with Search Suggestions

△ ▽ • Reply • Share ›

Vabz > Rasmus Plats • 2 years ago


To know how to do in VBA check last post in
this....https://groups.google.com/d/msg/excel-...
△ ▽ • Reply • Share ›

Ramesh Kumar Pantham > Vabz • 3 months ago


Dear Vabz, it is very useful to us, but how to set different form boxes in different c
△ ▽ • Reply • Share ›

Vabz > Jesus MIranda • 2 years ago


To know how to do in VBA check last post in this.......https://groups.google.com/d/msg/excel-...
△ ▽ • Reply • Share ›

Alia • 2 years ago


Hello - I followed the steps but I can't get the search drop down to appear in the Combo Box when I start
What am I missing?
△ ▽ • Reply • Share ›

Sumit Bansal Mod > Alia • 2 years ago


Hi Alia - I have created a video tutorial that might be helpful (at the end of the blog). Alternatively, y
also use the excel sheet download, and change the data and ranges accordingly. Hope this work
1△ ▽ • Reply • Share ›

FJ MV • 2 years ago
Great work, I like it. but I'm just curious how could I make it work if I want it to show me more columns of
item. Let's say If I search for United States so it will show me "United States" but in addition will also sho
don't know "number of people" - "latitud" - etc etc etc . Hope you can understand me. Thank you :)
△ ▽ • Reply • Share ›

Sumit Bansal Mod > FJ MV • 2 years ago


Hey.. Have a look at this.. http://trumpexcel.com/2013/07/...
△ ▽ • Reply • Share ›

Sumanth • 2 years ago


Hey Bansal, thats an awesome one. Im searching for this type of Drop
list, but this is only a one time search, for example consider a
invoice(a table), where we have to enter 'n' number items, can you
please give a solution for that? (OR) can we use the same tool without
combobox? Im preparing a sales estimate for my firm, can you please give
a solution for multi search tool. contact me on sumanthvzm@yahoo.co.in
or 9966939396
http://trumpexcel.com/2013/10/excel-drop-down-list-with-search-suggestions/ 12/19
6/1/2016 Create an Excel Drop Down List with Search Suggestions

Thanks in advance
△ ▽ • Reply • Share ›

Sumit Bansal Mod > Sumanth • 2 years ago


Hey Sumanth.. Not sure if I understand you correctly.. Have a look at this -
http://trumpexcel.com/2013/07/...
△ ▽ • Reply • Share ›

Saajidh > Sumit Bansal • 2 years ago


with reference to the above query... i have seen the link you have provided. That is not the
Eg. I am making a list or records and I want it to auto suggest the location from a list of lo
but how do you replicate a combo box for each line separately? pls email me
sad00007@gmail.com
△ ▽ • Reply • Share ›

Sumit Bansal Mod > Saajidh • 2 years ago


Hi Saajidh.. I am not sure I understand your query.. Can you upload sample data a
mention what you wish to do
△ ▽ • Reply • Share ›

Saajidh > Sumit Bansal • 2 years ago


let me show with data..

would love to upload data, how do i do so? meanwhile....

Date
Invoice no.
Telephone
Name
Address
Pcs

16-03-14

55544596
Mohamed Al Marri
Muaither
1

23-03-14

see more

△ ▽ • Reply • Share ›

http://trumpexcel.com/2013/10/excel-drop-down-list-with-search-suggestions/ 13/19
6/1/2016 Create an Excel Drop Down List with Search Suggestions

Sumit Bansal Mod > Saajidh • 2 years ago


You can upload the file on dropbox and share the link here. Would be easy to unde
when I have the data in Excel
△ ▽ • Reply • Share ›

Saajidh > Saajidh • 2 years ago


https://www.dropbox.com/s/vz2d...

pls see file...


△ ▽ • Reply • Share ›

dhiren • 2 years ago


hi, I create one Worksheet contain Master Data in A_Master sheet and in another sheet i have to select m
from drop down list. i use your Tip#20, its work perfect but when i try to select any master by pressing do
Excel stop working and start recovery!!!! i don't know what's wrong. i down load your given file from here
same things, as soon as i press down arrow key excel stop working in your file too. please give me any
for that.
△ ▽ • Reply • Share ›

Sumit Bansal Mod > dhiren • 2 years ago


Hi Dhiren.. Seems to be working fine on my system. Can you try once without the macro.. May w
△ ▽ • Reply • Share ›

Aaron > Sumit Bansal • 4 months ago


I am having the same issue with the arrow keys. Everything works great, but if I hit the do
excel crashes. I commented out the lines in the macro and it didn't crash, but when I use
it crashes.
△ ▽ • Reply • Share ›

Joe Striker • 2 years ago


I have been looking for this type of functionality for some time now. Now is it possible to have a range of
same column with type of functionality. The example only has the one combobox that links to B3. Could
for cells from say B3:B10? If you have a solution for this, could you e-mail me a sample at jstriker@oh.rr
△ ▽ • Reply • Share ›

Tony C > Joe Striker • a year ago


I'd like to have this solution as well
△ ▽ • Reply • Share ›

Suga > Joe Striker • 2 months ago


yes , how do we do this ?
△ ▽ • Reply • Share ›

http://trumpexcel.com/2013/10/excel-drop-down-list-with-search-suggestions/ 14/19
6/1/2016 Create an Excel Drop Down List with Search Suggestions

Arielle • 2 years ago


Hi. I have tried this method and it does work, however every time I enter a letter it gives me an error that
not enough resources to display properly. I am unsure why this is happening. Thanks for your help
△ ▽ • Reply • Share ›

Sumit Bansal Mod > Arielle • 2 years ago


Hi Arielle.. This happened with me once, and changing the zoom of the worksheet made it go aw
once with 100% zoom (hope it works for you too)
△ ▽ • Reply • Share ›

AVM • 2 years ago


Sumit: trick 20 is awesome! Thank you so much for sharing this! Any suggestion as to how I could arran
column that the values in the column get entered through the Data Validation list thing with a combo-box
search capabilities you explained?
△ ▽ • Reply • Share ›

Janice Diala Nunez • 2 years ago


Hi Sumit!

You save me with my problem...you are so good in excel and learned so much on your website.

I hope to learn more from you!

Thanks so much for this amazing website.

Is there a way to communicate directly to you...really want to learn more :-)

Thank you.

Janice Nunez.
△ ▽ • Reply • Share ›

Sumit Bansal Mod > Janice Diala Nunez • 2 years ago


Hi Janice.. Glad you found this useful :)

You can reach out to me at sumitbansal23@gmail.com


△ ▽ • Reply • Share ›

Janice Diala Nunez > Sumit Bansal • 2 years ago


Hi Sumit,

Thanks. I have just send you an email.


I hope you will have spare time to read it and would really need some help.

Thanks so much.
△ ▽ Reply Share ›
http://trumpexcel.com/2013/10/excel-drop-down-list-with-search-suggestions/ 15/19
6/1/2016 Create an Excel Drop Down List with Search Suggestions

△ ▽ • Reply • Share ›

Janice Diala Nunez > Janice Diala Nunez • 2 years ago


Hi Summit,
I tried adding up another combo box in the same sheet, hoping of the same result
another source, but ListFillRange doesn't allow me to save what I have typed in.
Any idea?
Thanks.
△ ▽ • Reply • Share ›

Bob Spaulding • 2 years ago


Love the search as you type combo box, how can I make the ranges dynamic? I would love to just keep
data to the end of the country list not have to recreate the formulas and named ranges every time.
Thanks
△ ▽ • Reply • Share ›

Sumit Bansal Mod > Bob Spaulding • 2 years ago


Thanks Bob.. Glad you like it!

Here is how you can make named range dynamic - http://trumpexcel.com/2014/01/...

Or even better, use excel table feature - http://trumpexcel.com/2014/03/...

Hope this helps!!


△ ▽ • Reply • Share ›

Missy • 2 years ago


I love this - worked for me - when i followed your instructions! THANK YOU!

BUT- the only difference is when i used to use regular Data Validation list- it was easy to copy that drop d
an entire column. How can i do that with this Active X control Drop down? Because i want to use it for at
thousand student records... need to line up with the other student data.
△ ▽ • Reply • Share ›

Sumit Bansal Mod > Missy • 2 years ago


Hey Missy.. Glad you liked it!! If you have hundreds or thousands of records, that this would be ve
consuming, as the combo box has to be inserted manually. You can try Data Validation drop dow
(although it may not be searchable), it is easy to execute
△ ▽ • Reply • Share ›

kikamd • 2 years ago


Hi Sumit, I have listened to your great tutorial many times and followed all the directions. Everything work
except for the search suggestion. I don't get a drop down list. When I return to the properties of the comb
notice that I am unable to save "DropDownList" in the ListFillRange. Can you help? Thank you!
△ ▽ • Reply • Share ›
http://trumpexcel.com/2013/10/excel-drop-down-list-with-search-suggestions/ 16/19
6/1/2016 Create an Excel Drop Down List with Search Suggestions

△ ▽ • Reply • Share ›

Erwin de Kruijf • 2 years ago


Hee, Lovin it! Only one thing, The combobox is showing te dropdown after every random action in Excel.
trick to only show the suggestions when i click on the combobox??
△ ▽ • Reply • Share ›

Janice Diala Nunez > Erwin de Kruijf • 2 years ago


I am also encountering this, the combo box shows all the time in another sheets or another exce
do I prevent this?
△ ▽ • Reply • Share ›

Erwin de Kruijf > Janice Diala Nunez • 2 years ago


Someone a solution? :)
△ ▽ • Reply • Share ›

Sumit Bansal Mod > Erwin de Kruijf • 2 years ago


Hi Erwin.. Try this VBA code instead:

Private Sub ComboBox1_GotFocus()


ComboBox1.ListFillRange = "=DropDownList"
Me.ComboBox1.DropDown
End Sub

Hope this works!!


△ ▽ • Reply • Share ›

Erwin de Kruijf > Sumit Bansal • 2 years ago


It Works! Thanks a lot!!
△ ▽ • Reply • Share ›

Semih > Sumit Bansal • 6 months ago


I've got the same problem. Thanks to your solutions, it works!
△ ▽ • Reply • Share ›

Joseph • 2 years ago


This is perfect! Its a fairly simply solution to an aggravating issue with data validation drop downs. One is
though, how would I change the VBA code to account for multiple drop-downs on a single sheet? I keep
into an issue where I have 2 separate instances of the code you provided, each one unique for the comb
pertains to, but when I start to type in the first box the second one is the one that pulls up the "suggestion
drop down list. This renders the first combo box useless since I cant ever get the list to offer suggestions
always reverts down to the next box. I have double checked that my names are correct in the code and t
isnt any cross over, but I cant get it to work. Would you have any suggestions for having multiple combo
one sheet?
http://trumpexcel.com/2013/10/excel-drop-down-list-with-search-suggestions/ 17/19
6/1/2016 Create an Excel Drop Down List with Search Suggestions
one sheet?

Thanks.

-Joe
△ ▽ • Reply • Share ›

Sumit Bansal Mod > Joseph • 2 years ago


Hi Joe, If you are using multiple combo-box, try this vba code instead:

Private Sub ComboBox1_GotFocus()


ComboBox1.ListFillRange = "=DropDownList"
Me.ComboBox1.DropDown
End Sub

Hope this works for you.


△ ▽ • Reply • Share ›

Nick • 2 years ago


I got a problem, I used your method, works great for one combo box, but when I insert a second one, tha
problems arise. Whenever I try to write in the second combo box, the drop down menu of the first combo
drops down showing the very same name I had selected for the first combo box. Hope all of this makes
Anything I am doing wrong ?
△ ▽ • Reply • Share ›

Sumit Bansal Mod > Nick • 2 years ago


Hi Nick. if you are using multiple combo-box, use this vba code instead:

Private Sub ComboBox1_GotFocus()


ComboBox1.ListFillRange = "=DropDownList"
Me.ComboBox1.DropDown
End Sub

I hope this works for you!!


△ ▽ • Reply • Share ›

Char > Sumit Bansal • 8 months ago


I'm having the same issue and can't figure out what's going wrong with it...
Tried the new code but same issue.
△ ▽ • Reply • Share ›

Cody Scoggins > Sumit Bansal • 3 months ago


I am also having this issue. Adding the GotFocus part did not work for me either.
△ ▽ • Reply • Share ›

Ravi C • 2 years ago


http://trumpexcel.com/2013/10/excel-drop-down-list-with-search-suggestions/ 18/19
6/1/2016 Create an Excel Drop Down List with Search Suggestions
Ravi C • 2 years ago
thanks u so much boss...
△ ▽ • Reply • Share ›

Load more comments

✉ Subscribe d Add Disqus to your site Add Disqus Add Privacy

←PREVIOUS POST NEXT PO

Copyright TrumpExcel.com (2013-2016)

http://trumpexcel.com/2013/10/excel-drop-down-list-with-search-suggestions/ 19/19

You might also like