Note: The other languages of the website are Google-translated. Back to English

How to autocomplete when typing in Excel drop down list?

For a data validation drop-down list with lots of items, you need to scroll up and down in the list to find the one you need or type the whole word into the list box correctly. Are there any methods to make an auto-completed drop-down list when typing the first letter or any relative characters? That will help people work more efficiently in worksheets with drop-down lists in cells. This tutorial provides two methods to help you achieve it.

Autocomplete when typing in drop down list with VBA code
Autocomplete when typing in drop down list with an amazing tool

More tutorials for drop down list...


Autocomplete when typing in drop down list with VBA code

Please do as follows to make a drop down list autocomplete after typing corresponding letters in the cell.

Firstly, you need to insert a combo box into the worksheet and change its properties.

1. Open the worksheet that contains the drop down list cell you want to make it autocomplete.

2. Before inserting a Combo box, you need to add the Developer tab to the Excel ribbon. If the Developer tab is showing on your ribbon, shift to step 3. Otherwise, do as follows: Click File > Options to open the Options window. In this Excel Options window, click Customize Ribbon in the left pane, check the Developer box, and then click the OK button. See screenshot:

3. Click Developer > Insert > Combo Box (ActiveX Control).

4. Draw a combo box in current worksheet. Right click it and then select Properties from the right-clicking menu.

5. In the Properties dialog box, please replace the original text in the (Name) field with TempCombo.

6. Turn off the Design Mode by clicking Developer > Design Mode.

Then, apply the below VBA code

7. Right click on current sheet tab and click View Code from the context menu. See screenshot:

8. In the opening Microsoft Visual Basic for Applications window, please copy and paste the below VBA code into the worksheet’s Code window.

VBA code: Autocomplete when typing in drop down list

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
'Update by Extendoffice: 2020/01/16
    Dim xCombox As OLEObject
    Dim xStr As String
    Dim xWs As Worksheet
    Dim xArr
    
    Set xWs = Application.ActiveSheet
    On Error Resume Next
    Set xCombox = xWs.OLEObjects("TempCombo")
    With xCombox
        .ListFillRange = ""
        .LinkedCell = ""
        .Visible = False
    End With
    If Target.Validation.Type = 3 Then
        Target.Validation.InCellDropdown = False
        Cancel = True
        xStr = Target.Validation.Formula1
        xStr = Right(xStr, Len(xStr) - 1)
        If xStr = "" Then Exit Sub
        With xCombox
            .Visible = True
            .Left = Target.Left
            .Top = Target.Top
            .Width = Target.Width + 5
            .Height = Target.Height + 5
            .ListFillRange = xStr
            If .ListFillRange = "" Then
                xArr = Split(xStr, ",")
                Me.TempCombo.List = xArr
            End If
            .LinkedCell = Target.Address
        End With
        xCombox.Activate
        Me.TempCombo.DropDown
    End If
End Sub
Private Sub TempCombo_KeyDown(ByVal KeyCode As MSForms.ReturnInteger, ByVal Shift As Integer)
    Select Case KeyCode
        Case 9
            Application.ActiveCell.Offset(0, 1).Activate
        Case 13
            Application.ActiveCell.Offset(1, 0).Activate
    End Select
End Sub

9. Press Alt + Q keys simultaneously to close the Microsoft Visual Basic Applications window.

From now on, when click on a drop down list cell, the drop down list will prompt automatically. You can start to type in the letter to make the corresponding item complete automatically in selected cell. See screenshot:

Note: This code does not work for merged cells.


Autocomplete when typing in drop down list with an amazing tool

Since VBA is hard to handle for many Excel users, here recommend the Searchable Drop-down List feature of Kutools for Excel to help you easily complete a drop-down list automatically when typing the first character.

Note: Before applying the feature, make sure that you have created drop-down lists in the worksheet. In this case, the drop-down lists are placed in D3:D9.

1. Click Kutools > Drop-down List > Searchable Drop-down List > Settings.

2. In the popping up Searchable Drop-down List dialog box, you need to make the following settings.

2.1) In the Apply to section, specify a range or worksheet where you want to apply the searchable drop-down list feature;
Tips: After selecting the Specified Scope radio button, you can choose Current worksheet, Current workbook or All workbooks from the drop-down list according to your needs.
2.2) In the Options section, choose the Matches only the beginning of the word option or the Case sensitive option or both;
Matches only the beginning of the word: Check this option, only the items that begin with the typed character are displayed, and the first matched item will be completed in the list box automatically. Uncheck this option to display items that contain the typed character.
Case sensitive: Check this option to perform case-sensitive matching with the typing characters.
2.3) Click OK.

3. After finish the settings, you need to enable the feature by clicking Kutools > Drop-down List > Searchable Drop-down List > Enable Searchable Drop-down List.

Now, when you click the drop down list cell, a list box with all items is displayed. You only need to type a character into the textbox to display all corresponding items, and use the Up or Down arrow to select the item you need or just let the first matching item automatically fill in the list box, and then press the Enter key to autocomplete the drop-down list cell with the matching item. See the below demo.

Click to know more about this feature.

  If you want to have a free trial ( 30-day) of this utility, please click to download it, and then go to apply the operation according above steps.


Related articles:

How to create drop down list with multiple checkboxes in Excel?
Many Excel users tend to create drop down list with multiple checkboxes in order to select multiple items from the list per time. Actually, you can’t create a list with multiple checkboxes with Data Validation. In this tutorial, we are going to show you two methods to create drop down list with multiple checkboxes in Excel. This tutorial provides the method to solve the problem.

Create drop down list from another workbook in Excel
It is quite easy to create a data validation drop down list among worksheets within a workbook. But if the list data you need for the data validation locates in another workbook, what would you do? In this tutorial, you will learn how to create a drop fown list from another workbook in Excel in details.

Create a searchable drop down list in Excel
For a drop down list with numerous values, finding a proper one is not an easy work. Previously we have introduced a method of auto completing drop down list when enter the first letter into the drop down box. Besides the autocomplete function, you can also make the drop down list searchable for enhancing the working efficiency in finding proper values in the drop down list. For making drop down list searchable, try the method in this tutorial.

Auto populate other cells when selecting values in Excel drop down list
Let’s say you have created a drop down list based on the values in cell range B8:B14. When you selecting any value in the drop down list, you want the corresponding values in cell range C8:C14 be automatically populated in a selected cell. For solving the problem, the methods in this tutorial will do you a favor.

More tutorials for drop down list...


The Best Office Productivity Tools

Kutools for Excel Solves Most of Your Problems, and Increases Your Productivity by 80%

  • Reuse: Quickly insert complex formulas, charts and anything that you have used before; Encrypt Cells with password; Create Mailing List and send emails...
  • Super Formula Bar (easily edit multiple lines of text and formula); Reading Layout (easily read and edit large numbers of cells); Paste to Filtered Range...
  • Merge Cells/Rows/Columns without losing Data; Split Cells Content; Combine Duplicate Rows/Columns... Prevent Duplicate Cells; Compare Ranges...
  • Select Duplicate or Unique Rows; Select Blank Rows (all cells are empty); Super Find and Fuzzy Find in Many Workbooks; Random Select...
  • Exact Copy Multiple Cells without changing formula reference; Auto Create References to Multiple Sheets; Insert Bullets, Check Boxes and more...
  • Extract Text, Add Text, Remove by Position, Remove Space; Create and Print Paging Subtotals; Convert Between Cells Content and Comments...
  • Super Filter (save and apply filter schemes to other sheets); Advanced Sort by month/week/day, frequency and more; Special Filter by bold, italic...
  • Combine Workbooks and WorkSheets; Merge Tables based on key columns; Split Data into Multiple Sheets; Batch Convert xls, xlsx and PDF...
  • More than 300 powerful features. Supports Office/Excel 2007-2019 and 365. Supports all languages. Easy deploying in your enterprise or organization. Full features 30-day free trial. 60-day money back guarantee.
kte tab 201905

Office Tab Brings Tabbed interface to Office, and Make Your Work Much Easier

  • Enable tabbed editing and reading in Word, Excel, PowerPoint, Publisher, Access, Visio and Project.
  • Open and create multiple documents in new tabs of the same window, rather than in new windows.
  • Increases your productivity by 50%, and reduces hundreds of mouse clicks for you every day!
officetab bottom
Comments (319)
No ratings yet. Be the first to rate!
This comment was minimized by the moderator on the site
I tried and it worked for just 2 days now in the properties, it is giving me an error message upon typing TempCombo that it is an ambiguous name. Please help
Jay
This comment was minimized by the moderator on the site
Excelent solution, thank you!
Yane
This comment was minimized by the moderator on the site
Hello... After adding this combo box, I am unable to copy and paste other elements on the worksheet. It allows me to copy by paste is greyed out. Also, is there a way to make the combo box work in merged cells? Thank you
Namastah
This comment was minimized by the moderator on the site
Same problem as another user - after adding this combo box, I am unable to copy and paste from one cell to another. The copy function seems to work, but the paste, paste special, and CTRL+V do not. Thank you.
Thomas
This comment was minimized by the moderator on the site
Hi Thomas... did you ever get a solution to this? I have yet to find one.
NAMASTAH
This comment was minimized by the moderator on the site
No real answer - I just go back to DEVELOPER and deselect DESIGN MODE when I must copy and past - remember to click DESIGN MODE again when you are finished; otherwise, your combo box will not function properly when you double click a cell.
Thomas
This comment was minimized by the moderator on the site
I am protecting the sheet so that the formulas can't be modified and when I protect the sheet the auto fill functionality no longer works. Do you have a solution for this?
Holly
This comment was minimized by the moderator on the site
have you found a solution for this?
Sam
This comment was minimized by the moderator on the site
How can I lock cells?
Sam
This comment was minimized by the moderator on the site
Works well.. Thanks.. Saved lot of my time.. One more dimension. With this code it works well in one column.. What changes we have to made in vba code to ensure this code works in other column also in the same sheet but with different data validation source
Jignesh
This comment was minimized by the moderator on the site
Thanks for immense help.. Lot of time of mine will be saved. This code works for only one data validation in a column in worksheet.. What changes we have to made in code to work with 2 data validation in 2 separate columns with separate data source
Jignesh
This comment was minimized by the moderator on the site
Does my data set/named range being used for my drop down list need to be on the same sheet for this to work? I am getting the combo box to be activated when I double click on the drop down but when I start typing nothing comes up? Any idea what the issue could be here? I followed all steps above. Thank you very much, Jared
Jared
This comment was minimized by the moderator on the site
I was able to get the code to work, but I am having issues saving the file, I get different error messages. once I have it saved and re-open the autocomplete function does not work. I am using Excel 2007. Can somebody provide assistance of how to save the file? a lot of help on the internet but I don't understand all of the commands. Thanks
Don
This comment was minimized by the moderator on the site
No where does it say how to add elements into the drop down box.
Jonathan Horovitz
This comment was minimized by the moderator on the site
Jonathan, have you found out how to do it?
Zal
This comment was minimized by the moderator on the site
Thanks for useful solution :-)
Makos
This comment was minimized by the moderator on the site
I have completed the autocomplete drop down list, however, i do not know how to show the values after typing the text in the drop down list. For example, in my DATA BASE SHEET, Column 1 consist of the items and column 2 & 3 consist the cost of the item. By typing the item in my drop down list IN THE MAIN SHEET in column 1, the cost of the items appears in column 2 & 3. Is it possible that it can be done? Help me please
Dante
This comment was minimized by the moderator on the site
where is range of source list for validation?
dddd
This comment was minimized by the moderator on the site
Do not forget to add the range of items for dropdown in the ComboBox Property 'ListFillRange"
Minhaj Ameen
This comment was minimized by the moderator on the site
Works Very nicely for drop downs using ='range' but functionality breaks as soon as the range is a result of a formula eg =IF(A1>0,'range','alternative'). Able to type in an unpopulated TempCombo
Mike
This comment was minimized by the moderator on the site
Hi! This is great. But how to I link my drop down list to the Combobox??? pls help.
Zal
This comment was minimized by the moderator on the site
Hello I have problem with this, i cant see any values on the drop down. Can anybody tell me how i can link my data range with the drop down? to show suggestions. if you can send me complected spread sheet that would be much appreciated.( My email is deshandsouza@gmail.com)
Desh
This comment was minimized by the moderator on the site
I got solution for the above! Just missed out to created Data validation drop down list. its works fine now.
Desh
This comment was minimized by the moderator on the site
Woohoo! Followed the steps in Autocomplete when typing in drop down list with VBA code and I've gotten exactly what I wanted to happen! Thank you! Thank you!
Jennifer
This comment was minimized by the moderator on the site
Well... it worked for one cell but when I tried to make it work for the whole column I couldn't :( What I have is Col A=Item name Col B= Date Created Col C= I want to enter Category but have dropdown list to choose from I have 723 "Items" so 723 rows where I want the dropdown list to appear as I go about entering the values. Any suggestions? Thank you in advance
Jennifer
This comment was minimized by the moderator on the site
but , how you make list for drop down from data ...
raj
There are no comments posted here yet
Load More
Leave your comments
Posting as Guest
×
Rate this post:
0  Characters
Suggested Locations