How to autocomplete when typing in Excel drop down list?
If you have a data validation drop down list with large values, you need to scroll down in the list just for finding the proper one, or type the whole word into the list box directly. If there is method for allowing to auto complete when typing the first letter in the drop down list, everything will become easier. In this tutorial, we will provide you with inserting Combo box in the worksheet and running VBA code together for achieving the autocomplete function in the drop down list.
Recommended Excel Productivity Tools
Firstly you need to insert a combo box into the worksheet and change its properties, and then running the VBA code to enable the autocomplete.
1. Get into the worksheet which contains the drop down list you want it to be autocompleted.
2. Before inserting the Combo box, you need to enable the Developer tab in the ribbon.
1). In Excel 2010 and 2013, click File > Options. And in the Options dialog box, click Customize Ribbon in the right pane, check the Developer box, then click the OK button. See screenshot:
2). In Outlook 2007, click Office button > Excel Options. In the Excel Options dialog box, click Popular in the right bar, then check the Show Developer tabin the Ribbon box, and finally click the OK button.
3. Then click Developer > Insert > Combo Box under ActiveX Controls. See screenshot:
4. Draw the combo box in current opened worksheet and right click it. Select Properties in the right-clicking menu.
5. In the Properties dialog box, you need to:
1). Change the name to TempCombo in the Name field;
2). Specify the font you need in the Font field;
3). Scroll down to select 1-fmMatchEntryComplete in the MatchEntry field;
4). Close the Properties dialog box.
6. Turn off the Design Mode with clicking Developer > Design Mode.
7. Right click on the current opened worksheet tab and click View Code. See screenshot:
8. Make sure that the current worksheet code editor is opened, and then copy and paste the below VBA code into it. See screenshot:
VBA code: Autocomplete when typing in drop down list
Private Sub Worksheet_SelectionChange(ByVal Target As Range) 'Update by Extendoffice: 2018/9/21 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. Click File > Close and Return to Microsoft Excel to close the Microsoft Visual Basic for Application window.
10. Now, just click the cell with drop down list, you can see the drop-down list is displayed as a combo box, then type the first letter into the box, the corresponding word will be completed automatically. See screenshot:
Note: This VBA code is not applied to merged cells.
- How to auto populate other cells when selecting values in Excel drop down list?
- How to create a drop down list calendar in Excel?
- How to create a searchable drop down list in Excel?
- How to create drop down list with multiple selections or values in Excel?
Recommended Productivity Tools for Excel
You are guest ( Sign Up? )
or post as a guest, but your post won't be published automatically.
To post as a guest, your comment is unpublished.
To post as a guest, your comment is unpublished.· 2 months agoHow can the code be modified such that pressing SHIFT + TAB moves the cursor left in the row?
To post as a guest, your comment is unpublished.· 3 months agoBut what if i have dynamic list ? How can i provide the input to the combobox and refresh everytime the data is been added?
To post as a guest, your comment is unpublished.· 26 days agoYou'll have to make a table of the dynamic dataset and assign it to the 'ListFillRange' within the properties of your combobox.
To post as a guest, your comment is unpublished.· 3 months agoHi Parth,
Sorry can’t help you with this. Welcome to post any question about Excel to our forum: https://www.extendoffice.com/forum.html. You will get more Excel supports from our professional or other Excel fans.
To post as a guest, your comment is unpublished.· 4 months agoAnyone looking for a simple dropdown input form in excell based on a list; i used Data.. "Data Validation" and then choose Allow: "List" and pointed the source at the list.
This does not do the auto complete but does avoid any macros or dev and just uses native simple Excel features.
To post as a guest, your comment is unpublished.· 4 months agoBuenas tardes dentro de esa lista predictiva tengo campos de lista con la función indirecto pero me elimina , como puedo conservar las funciones de lista conservando la búsqueda predictiva.
- ← Previous
- Next →