Direkt zum Inhalt

Wie wird die automatische Vervollständigung beim Eingeben einer Excel-Dropdown-Liste durchgeführt?

Bei einer Datenvalidierungs-Dropdown-Liste mit vielen Elementen müssen Sie in der Liste nach oben und unten scrollen, um das gewünschte Element zu finden, oder das ganze Wort richtig in das Listenfeld eingeben. Gibt es eine Möglichkeit, die Dropdown-Liste automatisch zu vervollständigen, wenn die entsprechenden Zeichen eingegeben werden? Dies würde den Benutzern helfen, effizienter in Arbeitsblättern mit Dropdown-Listen in Zellen zu arbeiten. Dieses Lernprogramm bietet zwei Methoden, mit denen Sie dies erreichen können.

Lassen Sie Dropdown-Listen mit VBA-Code automatisch vervollständigen
Automatische Vervollständigung von Dropdown-Listen in 2 Sekunden

Weitere Tutorials für Dropdown-Liste ...


Lassen Sie Dropdown-Listen mit VBA-Code automatisch vervollständigen

Gehen Sie wie folgt vor, um eine automatische Vervollständigung einer Dropdown-Liste zu erstellen, nachdem Sie die entsprechenden Buchstaben in die Zelle eingegeben haben.

Zunächst müssen Sie ein Kombinationsfeld in das Arbeitsblatt einfügen und dessen Eigenschaften ändern.
  1. Öffnen Sie das Arbeitsblatt, das die Dropdown-Listenzellen enthält, die Sie automatisch vervollständigen möchten.
  2. Bevor Sie ein Kombinationsfeld einfügen, müssen Sie die Registerkarte „Entwickler“ zum Excel-Menüband hinzufügen. Wenn die Registerkarte „Entwickler“ in Ihrem Menüband angezeigt wird, Fahren Sie mit Schritt 3 fort. Gehen Sie andernfalls wie folgt vor, damit die Registerkarte "Entwickler" im Menüband angezeigt wird: Klicken Sie auf Reichen Sie das > Optionen öffnen Optionen Fenster. In diesem Excel-Optionen Klicken Sie im Fenster Menüband anpassen Überprüfen Sie im linken Bereich die Entwickler:in / Unternehmen Feld, und klicken Sie dann auf OK Taste. Siehe Screenshot:
  3. Klicken Sie auf Kostenlos erhalten und dann auf Installieren. Entwickler:in / Unternehmen > Insert > Kombinationsfeld (ActiveX-Steuerung).
  4. Zeichnen Sie ein Kombinationsfeld im aktuellen Arbeitsblatt. Klicken Sie mit der rechten Maustaste darauf und wählen Sie dann aus Ferienhäuser aus dem Kontextmenü.
  5. Im Ferienhäuser Dialogfeld, bitte ersetzen Sie den Originaltext in der (Name) Feld mit TempCombo.
  6. Ausschalten Entwurfsmodus Beim Klicken Entwickler:in / Unternehmen > Entwurfsmodus.
Wenden Sie dann den folgenden VBA-Code an
  1. Klicken Sie mit der rechten Maustaste auf die aktuelle Blattregisterkarte und klicken Sie auf Code anzeigen aus dem Kontextmenü. Siehe Screenshot:
  2. In der Eröffnung Microsoft Visual Basic für Applikationen Kopieren Sie den folgenden VBA-Code und fügen Sie ihn in das Codefenster des Arbeitsblatts ein.
    VBA-Code: Autocomplete beim Eingeben der Dropdown-Liste
    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
  3. Presse- Andere + Q Tasten gleichzeitig zum Schließen der Microsoft Visual Basic-Anwendungen Fenster.

Wenn Sie von nun an auf eine Dropdown-Listenzelle klicken, wird die Dropdown-Liste automatisch angezeigt. Sie können mit der Eingabe des Buchstabens beginnen, um das entsprechende Element in der ausgewählten Zelle automatisch zu vervollständigen. Siehe Screenshot:

Hinweis: Dieser Code funktioniert nicht für zusammengeführte Zellen.

Automatische Vervollständigung der Dropdown-Liste in 2 Sekunden

Für die meisten Excel-Benutzer ist die obige VBA-Methode schwer zu beherrschen. Aber mit dem Durchsuchbare Dropdown-Liste Merkmal von Kutools for Excel, können Sie die automatische Vervollständigung für Dropdown-Listen zur Datenvalidierung einfach in aktivieren einen bestimmten Bereich in nur 2 Sekunden. Darüber hinaus ist diese Funktion für alle Excel-Versionen verfügbar.

Tipp: Bevor Sie dieses Tool anwenden, installieren Sie es bitte Kutools for Excel zuerst. Gehen Sie jetzt zum kostenlosen Download.

  1. Um die automatische Vervollständigung in Ihren Dropdown-Listen zu aktivieren, wählen Sie zunächst den Bereich mit den Dropdowns aus. Navigieren Sie dann zu Kutoolen Tab, wählen Sie Dropdown-Liste > Dropdown-Liste durchsuchbar machen, automatisches Popup.
  2. Im Machen Sie die Dropdown-Liste durchsuchbar Klicken Sie im Dialogfeld auf OK Schaltfläche, um die Einstellung zu speichern.
Ergebnis

Sobald die Konfiguration abgeschlossen ist, wird durch Klicken auf eine Dropdown-Listenzelle innerhalb des angegebenen Bereichs ein Listenfeld angezeigt. Bei der Eingabe von Zeichen wird, solange ein Element genau übereinstimmt, das gesamte Wort sofort im Listenfeld hervorgehoben und kann einfach durch Drücken der Eingabetaste in die Dropdown-Listenzelle eingefügt werden.


In Verbindung stehende Artikel:

Wie erstelle ich eine Dropdown-Liste mit mehreren Kontrollkästchen in Excel?
Viele Excel-Benutzer erstellen in der Regel eine Dropdown-Liste mit mehreren Kontrollkästchen, um mehrere Elemente pro Zeit aus der Liste auszuwählen. Tatsächlich können Sie mit der Datenüberprüfung keine Liste mit mehreren Kontrollkästchen erstellen. In diesem Tutorial zeigen wir Ihnen zwei Methoden zum Erstellen einer Dropdown-Liste mit mehreren Kontrollkästchen in Excel. Dieses Tutorial bietet die Methode zur Lösung des Problems.

Erstellen Sie eine Dropdown-Liste aus einer anderen Arbeitsmappe in Excel
Es ist recht einfach, eine Dropdown-Liste zur Datenüberprüfung zwischen Arbeitsblättern in einer Arbeitsmappe zu erstellen. Was würden Sie tun, wenn sich die für die Datenüberprüfung benötigten Listendaten in einer anderen Arbeitsmappe befinden? In diesem Tutorial erfahren Sie ausführlich, wie Sie eine Drop-Fown-Liste aus einer anderen Arbeitsmappe in Excel erstellen.

Erstellen Sie eine durchsuchbare Dropdown-Liste in Excel
Für eine Dropdown-Liste mit zahlreichen Werten ist es keine leichte Aufgabe, eine richtige zu finden. Zuvor haben wir eine Methode zum automatischen Ausfüllen der Dropdown-Liste eingeführt, wenn Sie den ersten Buchstaben in das Dropdown-Feld eingeben. Neben der Funktion zur automatischen Vervollständigung können Sie die Dropdown-Liste auch durchsuchbar machen, um die Arbeitseffizienz beim Finden geeigneter Werte in der Dropdown-Liste zu verbessern. Probieren Sie die Methode in diesem Lernprogramm aus, um die Dropdown-Liste durchsuchbar zu machen.

Füllen Sie andere Zellen automatisch aus, wenn Sie Werte in der Excel-Dropdown-Liste auswählen
Angenommen, Sie haben eine Dropdown-Liste basierend auf den Werten im Zellbereich B8: B14 erstellt. Wenn Sie einen Wert in der Dropdown-Liste auswählen, möchten Sie, dass die entsprechenden Werte im Zellbereich C8: C14 automatisch in eine ausgewählte Zelle eingefügt werden. Um das Problem zu lösen, tun Ihnen die Methoden in diesem Tutorial einen Gefallen.

Weitere Tutorials für Dropdown-Liste ...

Beste Office-Produktivitätstools

🤖 Kutools KI-Assistent: Revolutionieren Sie die Datenanalyse basierend auf: Intelligente Ausführung   |  Code generieren  |  Erstellen Sie benutzerdefinierte Formeln  |  Analysieren Sie Daten und erstellen Sie Diagramme  |  Rufen Sie Kutools-Funktionen auf...
Beliebte Funktionen: Suchen, markieren oder identifizieren Sie Duplikate   |  Leere Zeilen löschen   |  Kombinieren Sie Spalten oder Zellen, ohne Daten zu verlieren   |   Runde ohne Formel ...
Super-Lookup: VLookup mit mehreren Kriterien    VLookup mit mehreren Werten  |   VLookup über mehrere Blätter hinweg   |   Unscharfe Suche ....
Erweiterte Dropdown-Liste: Erstellen Sie schnell eine Dropdown-Liste   |  Abhängige Dropdown-Liste   |  Mehrfachauswahl Dropdown-Liste ....
Spaltenmanager: Fügen Sie eine bestimmte Anzahl von Spalten hinzu  |  Spalten verschieben  |  Schalten Sie den Sichtbarkeitsstatus ausgeblendeter Spalten um  |  Vergleichen Sie Bereiche und Spalten ...
Ausgewählte Funktionen: Rasterfokus   |  Designansicht   |   Große Formelleiste    Arbeitsmappen- und Blattmanager   |  Ressourcen (Autotext)   |  Datumsauswahl   |  Arbeitsblätter kombinieren   |  Zellen verschlüsseln/entschlüsseln    Senden Sie E-Mails nach Liste   |  Superfilter   |   Spezialfilter (Filter fett/kursiv/durchgestrichen...) ...
Top 15 Toolsets12 Text Tools (Text hinzufügen, Zeichen entfernen, ...)   |   50+ Chart Typen (Gantt-Diagramm, ...)   |   40+ Praktisch Formeln (Berechnen Sie das Alter basierend auf dem Geburtstag, ...)   |   19 Einfügen Tools (QR-Code einfügen, Bild aus Pfad einfügen, ...)   |   12 Umwandlung (Conversion) Tools (Zahlen zu Wörtern, Currency Conversion, ...)   |   7 Zusammenführen & Teilen Tools (Erweiterte Zeilen kombinieren, Zellen teilen, ...)   |   ... und mehr

Verbessern Sie Ihre Excel-Kenntnisse mit Kutools für Excel und erleben Sie Effizienz wie nie zuvor. Kutools für Excel bietet über 300 erweiterte Funktionen, um die Produktivität zu steigern und Zeit zu sparen.  Klicken Sie hier, um die Funktion zu erhalten, die Sie am meisten benötigen ...

Beschreibung


Office Tab Bringt die Oberfläche mit Registerkarten in Office und erleichtert Ihnen die Arbeit erheblich

  • Aktivieren Sie das Bearbeiten und Lesen von Registerkarten in Word, Excel und PowerPoint, Publisher, Access, Visio und Project.
  • Öffnen und erstellen Sie mehrere Dokumente in neuen Registerkarten desselben Fensters und nicht in neuen Fenstern.
  • Steigert Ihre Produktivität um 50 % und reduziert jeden Tag Hunderte von Mausklicks für Sie!
Comments (325)
No ratings yet. Be the first to rate!
This comment was minimized by the moderator on the site
Hi, many thanks for this material. It helped a lot.
This comment was minimized by the moderator on the site
Hello,

following on from my last comment:

I'm setting up 'standard' rows with the dropdown lists in them. These I'm wanting to copy below into an extensive spreadsheet.
Unfortunately the dropdown's don't copy down when I do that after using the VBA.
Is there a way to do whats described above?

Cheers,
Catherine
This comment was minimized by the moderator on the site
Hi Catherine,
The autocomplete drop-down lists generated by VBA code cannot be copied. You can only copy selected items that are displayed in the drop-down cell. Sorry for the inconvenience.
This comment was minimized by the moderator on the site
Hello,

Have implemented this successfully, so thank you for this page and code.
But now I have an associated problem...:

After doing all of the above points, the code works as described, but I cannot do any undo/redo actions in the entire spreadsheet.
Is there a way to turn this combo box on for when I want to work with the dropdowns and off for when I want to work in other cells? so that the undo/redo actions are possible again?
and note, yes I have turned the design mode off after doing the above steps, but it still doesn't help the problem.

Cheers,
Catherine
This comment was minimized by the moderator on the site
Hi Catherine Foley,
If you want to use the undo operation on cells other than the drop-down cells, the following VBA code can help you. Please give it a try.
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
'Update by Extendoffice: 2022/09/22
    Dim xCombox As OLEObject
    Dim xStr As String
    Dim xWs As Worksheet
    Dim xArr
    
    On Error Resume Next

    Set xWs = Application.ActiveSheet
    
    Set xCombox = xWs.OLEObjects("TempCombo")
    If Target.Validation.Type <> 3 Then
        If xCombox.Visible Then
            xCombox.Visible = False
        End If
        Exit Sub
    End If
    
    With xCombox
        .ListFillRange = ""
        .LinkedCell = ""
'        .Visible = False
    End With

    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 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
This comment was minimized by the moderator on the site
I hope now it will be upload
This comment was minimized by the moderator on the site
This code works really well for a single drop down. However, if I have 5 dropdowns using the same list of values but they need to operate independently of each other how is that accomplished? Despite my best efforts, if I put more than one combo box on the page, any selection is one is mirrored in the other.
This comment was minimized by the moderator on the site
Hi Mbuchmeier,Only need one combo box on the page. The code works on all drop-down lists in current page. You just need to manually click on the drop-down list cell to activate the combo box.
This comment was minimized by the moderator on the site
Hi crystal,
I am working with the combo box (The VBA code from 2021/11/05). It is working great and very useful but there are 2 issues:1. Issue #1: Usually when you work on any cell in Excel, there is indication on the row number which indicate which row you work about. When the combo box is opened this indication is missing2.  Issue #2: When the combo box is opened in the last column of the dynamic table, then it isn't  working as usual: when I select value from the list, the cell remain empty until I move the cursor to another cell
Attached screenshot.
Thank in advance
This comment was minimized by the moderator on the site
Hi Yoni,Thanks for your feedback. For the issues you mentioned:1. Issue #1: Excel does not highlight the row number when selecting an object in the worksheet. Since we use a combo box to replace the data validation drop-down list to handle the autocomplete operation, we can't show the indication in this case;2. Issue #2: I have tried as you described, but the problem cannot be reproduced. The screenshot you attached does not display, you need to save the screenshot and uplode it via the "Upload files" button below.
This comment was minimized by the moderator on the site
Hi Crystal,Thanks a lot for your response. Attached the screenshot. hope it will work now
This comment was minimized by the moderator on the site
Hi Yoni,Sorry for the inconvenience. The screenshot you uploaded is still not shown on the page. You need to save the screenshot on your disk in advance and then uplode it via the "Upload files" button. See the attached screenshot.
This comment was minimized by the moderator on the site
will, thank you is not enugh :::: alot of thank you then ;;;;; that worked like magic :)
This comment was minimized by the moderator on the site
Yeah, basically completely useless.  Want the cell to auto-complete when typing in a cell using list data validation.Tried this, and now I have to start over from scratch because I can't Undo it.  Thanks.Also loaded with syntax errors.
This comment was minimized by the moderator on the site
It works as it should be except for two things, first, there is no validation after insertion. i.e. if I typed anything at the combo then clicked enter it will accept the typed value while it should not do this since the data validation is being used to prevent such behaviors and make sure that the entered data is from selected range. Second, at the data validation list, sometimes I use big range with empty cells and select ignore empty at validation list but the combo takes all the range and shows it, will be nice to remove the empty cells from the combo range.
Thanks & hope you can implement these things to make it perfect.
This comment was minimized by the moderator on the site
Hi, AhmedThe VBA below helps to solve the problem of blank cells. Since the Combo box accepts the value that are not in the list, we still can't find a way to solve this problem. Sorry for the inconvenience.
<div data-tag="code">Private Sub Worksheet_SelectionChange(ByVal Target As Range)
'Update by Extendoffice: 2021/11/05
Dim xCombox As OLEObject
Dim xStr As String
Dim xWs As Worksheet
Dim xArr, xArr1
Dim xRg As Range
Dim xSrc As Variant
Dim xI, xJ, xIndex, xCount As Integer

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
Set xRg = Range(xStr)
If xRg Is Nothing Then
xArr1 = Split(xStr, ",")
Else
ReDim xArr1(0 To xRg.Count - 1)
For xI = 0 To xRg.Count - 1
xArr1(xI) = xRg.Item(xI + 1).Value
Next
End If
xI = 0
xCount = UBound(xArr1) + 1
For xJ = 0 To UBound(xArr1)
If Replace(xArr1(xJ), " ", "") = "" Then xCount = xCount - 1
Next
ReDim xArr(0 To xCount - 1)
xIndex = 0
For xJ = 0 To UBound(xArr1)
If Replace(xArr1(xJ), " ", "") <> "" Then
xArr(xIndex) = xArr1(xJ)
xIndex = xIndex + 1
End If
Next
xStr = ""
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
This comment was minimized by the moderator on the site
Hi Crystal,
I am working with the combo box (The VBA code from 2021/11/05). It is working great and so useful! thanks a lot.
I found the source of my problem. There was a line of freeze panes which override the combo box.
The only problem now is that the Undo is not working. Any idea?
Thanks in advanced,
Yoni
This comment was minimized by the moderator on the site
Hi,
The code does not support Undo. Sorry for the inconvenience.
This comment was minimized by the moderator on the site
Thanks. Maybe do you know why Worksheet_Change event is not firing once I choose value from the combo box?
This comment was minimized by the moderator on the site
Hi, could you please doublecheck this code, when I use it instead of the dropdown list appearing, the source for the dropdown appears instead. This is the exact function I want, could you please fix it.
This comment was minimized by the moderator on the site
If you use a named range or something similar, like I have with a table column, it will display the named range name instead of the values in that named range. To get what you want, you need to change the xStr to display the worksheet range of that named range, since the .ListFillRange does not take in named ranges directly. This should accomplish it : dim RangeAddress as String: RangeAddress = Range(YourNamedRange).addressand then make the xStr something like this: xStr = "YourWorksheetNameWithTheNamedRangeInIt!" & RangeAddress (important: add the '!' for the sheet reference)
This will make your xStr look something like: NamedRangeSheet!$A$1:$A$5
xStr = Right(xStr, Len(xStr) - 1)

If .ListFillRange = "" Then
xArr = Split(xStr, ",")
Me.TempCombo.List = xArr
End If

with these adjustments your combobox should display the list values instead of the source
This comment was minimized by the moderator on the site
Hi Syu,Sorry I don't quite understand your description. Can you try to be more specific of it?After applying the VBA code mentioned in the above method, when the cell with the data validation drop-down list is checked, the drop-down list turn into a combo box, and then all the items in the list are listed. 
This comment was minimized by the moderator on the site
do you have an example file please?
This comment was minimized by the moderator on the site
Hello. The code is very cool. Please make sure that the formula "INDIRECT" is carried out and displayed. It is very necessary
This comment was minimized by the moderator on the site
The code is not working for a validation list which is created by vba code and the source is a named range
There are no comments posted here yet
Load More
Please leave your comments in English
Posting as Guest
×
Rate this post:
0   Characters
Suggested Locations