Direkt zum Inhalt

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.

Verwenden Sie das Listenfeld, um eine Dropdown-Liste mit mehreren Kontrollkästchen zu erstellen
A: Erstellen Sie ein Listenfeld mit Quelldaten
B: Benennen Sie die Zelle, in der Sie die ausgewählten Elemente suchen
C: Fügen Sie eine Form ein, um die Ausgabe der ausgewählten Elemente zu erleichtern
Erstellen Sie mit einem erstaunlichen Tool ganz einfach eine Dropdown-Liste mit Kontrollkästchen
Weitere Tutorials für Dropdown-Liste ...


Verwenden Sie das Listenfeld, um eine Dropdown-Liste mit mehreren Kontrollkästchen zu erstellen

Wie im folgenden Screenshot gezeigt, sind im aktuellen Arbeitsblatt alle Namen im Bereich A2: A11 die Quelldaten des Listenfelds. Klicken Sie auf die Schaltfläche in Zelle C4, um die ausgewählten Elemente auszugeben. Alle ausgewählten Elemente im Listenfeld werden in Zelle E4 angezeigt. Um dies zu erreichen, gehen Sie bitte wie folgt vor.

A. Erstellen Sie ein Listenfeld mit Quelldaten

1 Klicken Entwickler:in / Unternehmen > Insert > Listenfeld (Active X Control). Siehe Screenshot:

2. Zeichnen Sie ein Listenfeld im aktuellen Arbeitsblatt, klicken Sie mit der rechten Maustaste darauf und wählen Sie es aus Ferienhäuser aus dem Kontextmenü.

3. In dem Ferienhäuser Dialogfeld müssen Sie wie folgt konfigurieren.

  • 3.1 In der ListFillRange Geben Sie im Feld den Quellbereich ein, den Sie in der Liste anzeigen möchten (hier gebe ich den Bereich ein A2: A11);
  • 3.2 In der Listenstil Wählen Sie 1 - fmList-Stiloption;
  • 3.3 In der Mehrfachauswahl Wählen Sie 1 - fmMultiSelectMulti;
  • 3.4 Schließen Sie die Ferienhäuser Dialogbox. Siehe Screenshot:

B: Benennen Sie die Zelle, in der Sie die ausgewählten Elemente suchen

Wenn Sie alle ausgewählten Elemente in eine bestimmte Zelle wie E4 ausgeben müssen, gehen Sie wie folgt vor.

1. Wählen Sie die Zelle E4 aus und geben Sie ein ListBoxAusgabe in die Namensfeld und drücke die Enter Key.

C. Fügen Sie eine Form ein, um die Ausgabe der ausgewählten Elemente zu erleichtern

1 Klicken Insert > Formen > Rechteck. Screenshot:

2. Zeichnen Sie ein Rechteck in Ihr Arbeitsblatt (hier zeichne ich das Rechteck in Zelle C4). Klicken Sie dann mit der rechten Maustaste auf das Rechteck und wählen Sie Makro zuweisen aus dem Kontextmenü.

3. In dem Makro zuweisen Klicken Sie im Dialogfeld auf die Schaltfläche Neu .

4. In der Öffnung Microsoft Visual Basic für Applikationen Fenster, bitte ersetzen Sie den Originalcode im Modul Fenster mit dem folgenden VBA-Code.

VBA-Code: Erstellen Sie eine Liste mit mehreren Kontrollkästchen

Sub Rectangle1_Click()
'Updated by Extendoffice 20200730
Dim xSelShp As Shape, xSelLst As Variant, I, J As Integer
Dim xV As String
Set xSelShp = ActiveSheet.Shapes(Application.Caller)
Set xLstBox = ActiveSheet.ListBox1
If xLstBox.Visible = False Then
    xLstBox.Visible = True
    xSelShp.TextFrame2.TextRange.Characters.Text = "Pickup Options"
    xStr = ""
    xStr = Range("ListBoxOutput").Value
    
    If xStr <> "" Then
         xArr = Split(xStr, ";")
    For I = xLstBox.ListCount - 1 To 0 Step -1
        xV = xLstBox.List(I)
        For J = 0 To UBound(xArr)
            If xArr(J) = xV Then
              xLstBox.Selected(I) = True
              Exit For
            End If
        Next
    Next I
    End If
Else
    xLstBox.Visible = False
    xSelShp.TextFrame2.TextRange.Characters.Text = "Select Options"
    For I = xLstBox.ListCount - 1 To 0 Step -1
        If xLstBox.Selected(I) = True Then
        xSelLst = xLstBox.List(I) & ";" & xSelLst
        End If
    Next I
    If xSelLst <> "" Then
        Range("ListBoxOutput") = Mid(xSelLst, 1, Len(xSelLst) - 1)
    Else
        Range("ListBoxOutput") = ""
    End If
End If
End Sub

Hinweis: Im Code Rechteck1 ist der Formname; ListBox1 ist der Name des Listenfelds; Optionen wählen und Abholoptionen sind die angezeigten Texte der Form; und die ListBoxAusgabe ist der Bereichsname der Ausgabezelle. Sie können sie je nach Bedarf ändern.

5. Drücken Sie Andere + Q Tasten gleichzeitig zum Schließen der Microsoft Visual Basic für Applikationen Fenster.

6. Klicken Sie auf das Rechteck, um das Listenfeld zu falten oder zu erweitern. Wenn das Listenfeld erweitert wird, überprüfen Sie die Elemente im Listenfeld und klicken Sie erneut auf das Rechteck, um alle ausgewählten Elemente in Zelle E4 auszugeben. Siehe unten Demo:

7. Speichern Sie dann die Arbeitsmappe als Excel MacroEnable-Arbeitsmappe für die zukünftige Wiederverwendung des Codes.


Erstellen Sie eine Dropdown-Liste mit Kontrollkästchen mit einem erstaunlichen Tool

Die obige Methode ist zu mehrstufig, um einfach zu handhaben. Hier kann man das nur empfehlen Dropdown-Liste mit Kontrollkästchen Nutzen von Kutools für Excel Damit Sie auf einfache Weise eine Dropdown-Liste mit Kontrollkästchen in einem bestimmten Bereich, einem aktuellen Arbeitsblatt, einer aktuellen Arbeitsmappe oder allen geöffneten Arbeitsmappen erstellen können, die Ihren Anforderungen entsprechen. Siehe die folgende Demo:
Laden Sie es jetzt herunter und probieren Sie es aus! (30 Tage kostenloser Trail)

Neben der obigen Demo bieten wir auch eine schrittweise Anleitung, um zu demonstrieren, wie diese Funktion angewendet wird, um diese Aufgabe zu erfüllen. Bitte gehen Sie wie folgt vor.

1. Öffnen Sie das Arbeitsblatt, für das Sie die Dropdown-Liste Datenüberprüfung festgelegt haben, und klicken Sie auf Kutoolen > Dropdown-Liste > Dropdown-Liste mit Kontrollkästchen > Einstellungen. Screenshot:

2. In dem Dropdown-Liste mit Einstellungen für Kontrollkästchen Dialogfeld, bitte wie folgt konfigurieren.

  • 2.1) In der Gelten Geben Sie im Abschnitt den Anwendungsbereich an, in dem Sie Kontrollkästchen für Elemente in der Dropdown-Liste erstellen. Sie können a angeben bestimmte Reichweite, aktuelles Arbeitsblatt, aktuelle Arbeitsmappe or alle geöffneten Arbeitsmappen basierend auf Ihre Bedürfnisse.
  • 2.2) In der Model Wählen Sie im Abschnitt einen Stil aus, in dem Sie die ausgewählten Elemente ausgeben möchten.
  • Hier nimmt die Ändern Wenn Sie diese Option als Beispiel auswählen, wird der Zellenwert basierend auf den ausgewählten Elementen geändert.
  • 2.3) In der Separator Geben Sie in das Feld ein Trennzeichen ein, mit dem Sie die mehreren Elemente trennen.
  • 2.4) In der Textrichtung Wählen Sie im Abschnitt eine Textrichtung aus, die Ihren Anforderungen entspricht.
  • 2.5) Klicken Sie auf OK .

3. Klicken Sie im letzten Schritt auf Kutoolen > Dropdown-Liste > Dropdown-Liste mit Kontrollkästchen > Dropdown-Liste der Kontrollkästchen aktivieren um diese Funktion zu aktivieren.

Wenn Sie von nun an auf die Zellen mit der Dropdown-Liste in einem bestimmten Bereich klicken, wird ein Listenfeld angezeigt. Wählen Sie die Elemente aus, indem Sie die Kontrollkästchen aktivieren, die wie in der folgenden Demo in die Zelle ausgegeben werden sollen ).

Weitere Informationen zu dieser Funktion finden Sie unter Bitte besuchen Sie hier.

  Wenn Sie eine kostenlose Testversion (30 Tage) dieses Dienstprogramms wünschen, Bitte klicken Sie, um es herunterzuladenund wenden Sie dann die Operation gemäß den obigen Schritten an.


In Verbindung stehende Artikel:

Autocomplete beim Eingeben der Excel-Dropdown-Liste
Wenn Sie eine Dropdown-Liste zur Datenüberprüfung mit großen Werten haben, müssen Sie in der Liste nach unten scrollen, um die richtige zu finden, oder das ganze Wort direkt in das Listenfeld eingeben. Wenn es eine Methode gibt, mit der die automatische Vervollständigung beim Eingeben des ersten Buchstabens in die Dropdown-Liste ermöglicht wird, wird alles einfacher. 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 (70)
No ratings yet. Be the first to rate!
This comment was minimized by the moderator on the site
Hello-

This is fabulous, but I was wondering if there is a way to call the code as a subroutine, ie Click Button 1, run this code with X List Box and X Output cell. I want to pass the listbox and the output cell as variables into this code. Any help would be greatly appreciated.

I've tried this:
Private Sub Rectangle1_Click()
Call MultiSelctDropdown(ListBox1,Output1)
End Sub

Private Sub Rectangle2_Click()
Call MultiSelctDropdown(ListBox2,Output2)
End Sub

Private Sub MultiSelectDropdown(ListBox As String, Output As String)
Dim xSelShp As Shape, xSelLst As Variant, I, J As Integer
Dim xV As String
Set xSelShp = ActiveSheet.Shapes(Application.Caller)
Set xLstBox = ActiveSheet.ListBox
If xLstBox.Visible = False Then
xLstBox.Visible = True
xSelShp.TextFrame2.TextRange.Characters.Text = "Enter"
xStr = ""
xStr = Range("Output").Value

If xStr <> "" Then
xArr = Split(xStr, ",")
For I = xLstBox.ListCount - 1 To 0 Step -1
xV = xLstBox.List(I)
For J = 0 To UBound(xArr)
If xArr(J) = xV Then
xLstBox.Selected(I) = True
Exit For
End If
Next
Next I
End If
Else
xLstBox.Visible = False
xSelShp.TextFrame2.TextRange.Characters.Text = "Click Here to Select Products"
For I = xLstBox.ListCount - 1 To 0 Step -1
If xLstBox.Selected(I) = True Then
xSelLst = xLstBox.List(I) & "," & xSelLst
End If
Next I
If xSelLst <> "" Then
Range("Output") = Mid(xSelLst, 1, Len(xSelLst) - 1)
Else
Range("Output") = ""
End If
End If
End Sub
This comment was minimized by the moderator on the site
Ok I figured this one out (see below)

But now I want to have only ONE list box that I can use over and over again with different buttons but different output depending on the button pushed. And the code below works for this EXCEPT the items selected when the list box pops up includes all items that have been outputted from the code.

If list box1 contains

Apples
Oranges
Pears
Kiwi

and button 1 is pressed and Apples is selected, when button 2 is pressed Apples is already selected, and if during button press 2 pears is selected when you go back to button 1 Apples AND Pears are selected.

How can I either clear all selected when a button is pressed OR make the selected options equal to the output.


Private Sub Button1_Click()
Call ProductSelection(ActiveSheet.ListBox1, "Button1Output", 243, 215)
End Sub
Private Sub Button2_Click()
Call ProductSelection(ActiveSheet.ListBox1, "Button2Output", 472, 215)
End Sub



Private Sub ProductSelection(xListBox As Object, Output As String, left As Integer, height As Integer)
Dim xSelShp As Shape, xSelLst As Variant, I, J As Integer
Dim xV As String
Set xSelShp = ActiveSheet.Shapes(Application.Caller)
Set xLstBox = xListBox
If xLstBox.Visible = False Then
xLstBox.Visible = True
xLstBox.left = left
xLstBox.height = height
xSelShp.TextFrame2.TextRange.Characters.Text = "Enter"
xStr = ""
xStr = Range(Output).Value

If xStr <> "" Then
xArr = Split(xStr, ",")
For I = xLstBox.ListCount - 1 To 0 Step -1
xV = xLstBox.List(I)
For J = 0 To UBound(xArr)
If xArr(J) = xV Then
xLstBox.Selected(I) = True
Exit For
End If
Next
Next I
End If
Else
xLstBox.Visible = False
xSelShp.TextFrame2.TextRange.Characters.Text = "Click Here to Select Products"
For I = xLstBox.ListCount - 1 To 0 Step -1
If xLstBox.Selected(I) = True Then
xSelLst = xLstBox.List(I) & "," & xSelLst
End If
Next I
If xSelLst <> "" Then
Range(Output) = Mid(xSelLst, 1, Len(xSelLst) - 1)
Else
Range(Output) = ""
End If
End If
End Sub
This comment was minimized by the moderator on the site
Hi there- this is super helpful, thank you! Can you tell me how I can draw a list box based on a list in a different worksheet (but same file)? I've tried entering my worksheet name (i.e., 'lists') followed by the range in the list fill range (after clicking on Properties) but this does not work.Thanks!
This comment was minimized by the moderator on the site
Hi Meghan,Supposing you want to <span style="letter-spacing: 0.2px; color: inherit; font-family: inherit; font-style: inherit; font-variant-ligatures: inherit; font-variant-caps: inherit;">ListBox1</span><span style="letter-spacing: 0.2px; color: inherit; font-family: inherit; font-style: inherit; font-variant-ligatures: inherit; font-variant-caps: inherit;">Sheet1</span><div data-tag="code">Sub listboxlistfillrangefromdifferentsheet()
Sheet1.ListBox1.ListFillRange = Sheet2.Range("A2:A20").Address(, , , True)
End Sub
This comment was minimized by the moderator on the site
hello, I have a problem with the list box: to make the list going down, I have to click on the box that allows the list to go down but when I click, it does not go down automatically, I have to click outside the list so that it refreshes and the list goes down, what to do? Thank you
This comment was minimized by the moderator on the site
Hi,You can't scroll ActiveX Listbox by mouse wheel. There is no setting for it.

This comment was minimized by the moderator on the site
Hi, thank you for sharing this! I have a question though, is it possible to populate different cells based on the selected option?For example, instead of having everything in one cell, each selection is populated in the cell below the earlier selection. Thank you!
This comment was minimized by the moderator on the site
Hi faez,
The VBA below helps to populate the selected options in different cells on the same row. Please have a try.

Sub Rectangle2_Click()
'Updated by Extendoffice 20211124
Dim xSelShp As Shape, xSelLst As Variant, I As Integer
Dim xRg As Range
Set xSelShp = ActiveSheet.Shapes(Application.Caller)
Set xLstBox = ActiveSheet.ListBox1
If xLstBox.Visible = False Then
xLstBox.Visible = True
xSelShp.TextFrame2.TextRange.Characters.Text = "Pickup Options"
Else
xLstBox.Visible = False
xSelShp.TextFrame2.TextRange.Characters.Text = "Select Options"
Set xRg = Range("ListBoxOutput")
For I = 0 To xLstBox.ListCount - 1
If xLstBox.Selected(I) = True Then
xSelLst = xLstBox.List(I)
xRg.Value = Mid(xSelLst, 1, Len(xSelLst))
Set xRg = xRg.Offset(0, 1)
End If
Next I
End If
End Sub
This comment was minimized by the moderator on the site
Hi Crystal,
Thanks a lot for this code, very helpful and convenient. One question : how to adpat it in order not to have the separator ";" if only one item is selected ?
This comment was minimized by the moderator on the site
Hi Eloi,No separator is displayed when you select only one item in the list.
This comment was minimized by the moderator on the site
Thanks Crystal, the mistake was in my adaptation of the code.
If someone needs to adapt it with a click on a cell instead of a click on a shape, you could try this (with a call to this sub in your sheet, with a condition when your cell is selected)

Sub affichage_liste(xLstBox As MSForms.ListBox, texte1 As String)
'Updated by Extendoffice 20200730
Dim xSelLst As Variant, I, J As Integer
Dim xV As String

If xLstBox.Visible = False Then
xLstBox.Visible = True
xStr = ""
xStr = Range(texte1).Value

If xStr <> "" Then
xArr = Split(xStr, ";")
For I = xLstBox.ListCount - 1 To 0 Step -1
xV = xLstBox.List(I)
For J = 0 To UBound(xArr)
If xArr(J) = xV Then
xLstBox.Selected(I) = True
Exit For
End If
Next
Next I
End If
Else
xLstBox.Visible = False
For I = xLstBox.ListCount - 1 To 0 Step -1
If xLstBox.Selected(I) = True Then
xSelLst = xLstBox.List(I) & "; " & xSelLst
End If
Next I
If xSelLst <> "" Then
Range(texte1) = Mid(xSelLst, 1, Len(xSelLst) - 2)
Else
Range(texte1) = ""
End If
End If
End Sub
This comment was minimized by the moderator on the site
Hi Eloi,The code you provided doesn't seem to work. I have modified it again as below.  After adding the code in your Sheet(Code) window, go back to the worksheet, click the cell C4 to expand the list box, after selecting items from the list box, click on any cell in the worksheet to output the selection, and no separator is displayed when you select only one item in the list.
<div data-tag="code">Private Sub Worksheet_SelectionChange(ByVal Target As Range)
'Updated by Extendoffice 20211223
Dim xSelLst As Variant, I, J As Integer
Dim xV As String
Set xLstBox = ActiveSheet.ListBox1

If Target.Address = "$C$4" Then


If xLstBox.Visible = False Then
xLstBox.Visible = True
xStr = ""
xStr = Range("ListBoxOutput").Value

If xStr <> "" Then
xArr = Split(xStr, ";")
For I = xLstBox.ListCount - 1 To 0 Step -1
xV = xLstBox.List(I)
For J = 0 To UBound(xArr)
If xArr(J) = xV Then
xLstBox.Selected(I) = True
Exit For
End If
Next
Next I
End If

End If

Else
xLstBox.Visible = False

For I = xLstBox.ListCount - 1 To 0 Step -1
If xLstBox.Selected(I) = True Then
xSelLst = xLstBox.List(I) & "; " & xSelLst
End If
Next I
If xSelLst <> "" Then
Range("ListBoxOutput") = Mid(xSelLst, 1, Len(xSelLst) - 2)
Else
Range("ListBoxOutput") = ""
End If


End If

End Sub
This comment was minimized by the moderator on the site
Thanks a lot Crystal
This comment was minimized by the moderator on the site
Bonjour,Je suis plus que novice sur excel étant sur mac je ne peux utiliser l'outil Kutools j'ai donc tenté de créer une liste déroulante où l'on peut cocher plusieurs items mais je bloque dès le début dans l'onglet développeur puisque je n'ai pas du tout l'outil "insert".Merci pour votre aide
This comment was minimized by the moderator on the site
Hi I am newbie to VBA. I tried to execute the code but i get the following error "Run-time error '-2147024809 (80070057)': The Item with the specified name wasn't found". Can you help me with this
This comment was minimized by the moderator on the site
Hi Gowtham,It seem that this error occurs when you running the code directly in the Code editor (the Microsoft Visual Basic for Applications window).After adding the code, please press the Alt + Q keys to close the Microsoft Visual Basic for Applications window. Go back to the worksheet and execute the code by clicking the rectangle button (see the .gif picture in step 6).
This comment was minimized by the moderator on the site
Hi Crystal, even after your tip am getting same error as Gowtham. My error is right after protect my sheet. Would you please help me with this issue?
This comment was minimized by the moderator on the site
Hi Crystal, Even After your tip I am getting same error as Gowtham.
This comment was minimized by the moderator on the site
Hi Mina,Which Excel and Windows version are you using?
This comment was minimized by the moderator on the site
Hello,I added this code to an existing macro template and it is loading the selections correctly, but it is NOT clearing out the x on the selected items..This will be used on/in a template worksheet that has submit button/macro to load the worksheet answers into a hidden worksheet with a data table.And am happy to say the field data loaded to the cell, transferred into my variable, and loaded to the data table as expected.
This code was a HUGE blessing!
I use excel 2016
How do I fix this. I am using this version from below.
Sub Rectangle1_Click()
'Updated by Extendoffice 20200730
Dim xSelShp As Shape, xSelLst As Variant, I, J As Integer
Dim xV As String
Set xSelShp = ActiveSheet.Shapes(Application.Caller)
Set xLstBox = ActiveSheet.ListBox1
If xLstBox.Visible = False Then
xLstBox.Visible = True
xSelShp.TextFrame2.TextRange.Characters.Text = "Pickup Options"
xStr = ""
xStr = Range("ListBoxOutput").Value

If xStr <> "" Then
xArr = Split(xStr, ";")
For I = xLstBox.ListCount - 1 To 0 Step -1
xV = xLstBox.List(I)
For J = 0 To UBound(xArr)
If xArr(J) = xV Then
xLstBox.Selected(I) = True
Exit For
End If
Next
Next I
End If
Else
xLstBox.Visible = False
xSelShp.TextFrame2.TextRange.Characters.Text = "Select Options"
For I = xLstBox.ListCount - 1 To 0 Step -1
If xLstBox.Selected(I) = True Then
xSelLst = xLstBox.List(I) & ";" & xSelLst
End If
Next I
If xSelLst <> "" Then
Range("ListBoxOutput") = Mid(xSelLst, 1, Len(xSelLst) - 1)
Else
Range("ListBoxOutput") = ""
End If
End If
End Sub
This comment was minimized by the moderator on the site
Hello,

I'm having a similar problem to Tom from 2 months ago. When I try to share my file with a colleague, the multi-select droplist list isn't working. However, I used the Kutools add-on to create this as opposed to creating it myself. I've also saved it as macro-enabled.
This comment was minimized by the moderator on the site
Hi ben,The multi-select drop down list feature of Kutools only works in the Excel that installed our Kutools. We are working on this issue, sorry for the inconvenience.
This comment was minimized by the moderator on the site
Hello I looking the resolve for problem with saving choosing on drop down list

when i choose something on list and send file to my colleague, then when he open file and want to check my list then list has cleared and cell "ListBoxOutput" was cleared too.

help please :)
This comment was minimized by the moderator on the site
Hi Tom,
Please save the workbook as an "Excel MacroEnable Workbook" and then send this .xlsm file to your colleague.
This comment was minimized by the moderator on the site
hello i save this file in this format from beginning ;), but without effect. still when i fill file and send to someone then when he opened file and click to "shape" then macro started from begin and cleared list
This comment was minimized by the moderator on the site
Hi Tom,
I am sorry for the mistake. The code has been updated again. Please have a try.

Sub Rectangle1_Click()

'Updated by Extendoffice 20200730

Dim xSelShp As Shape, xSelLst As Variant, I, J As Integer

Dim xV As String

Set xSelShp = ActiveSheet.Shapes(Application.Caller)

Set xLstBox = ActiveSheet.ListBox1

If xLstBox.Visible = False Then

xLstBox.Visible = True

xSelShp.TextFrame2.TextRange.Characters.Text = "Pickup Options"

xStr = ""

xStr = Range("ListBoxOutput").Value



If xStr <> "" Then

xArr = Split(xStr, ";")

For I = xLstBox.ListCount - 1 To 0 Step -1

xV = xLstBox.List(I)

For J = 0 To UBound(xArr)

If xArr(J) = xV Then

xLstBox.Selected(I) = True

Exit For

End If

Next

Next I

End If

Else

xLstBox.Visible = False

xSelShp.TextFrame2.TextRange.Characters.Text = "Select Options"

For I = xLstBox.ListCount - 1 To 0 Step -1

If xLstBox.Selected(I) = True Then

xSelLst = xLstBox.List(I) & ";" & xSelLst

End If

Next I

If xSelLst <> "" Then

Range("ListBoxOutput") = Mid(xSelLst, 1, Len(xSelLst) - 1)

Else

Range("ListBoxOutput") = ""

End If

End If

End Sub
This comment was minimized by the moderator on the site
Now it's working perfectly.

Many thanks for your help
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