Ana içeriğe atla

Excel'de birden çok onay kutusu içeren açılır liste nasıl oluşturulur?

Yazarı: Siluvia Son Değiştirilme Tarihi: 2023-02-28

Birçok Excel kullanıcısı, her seferinde listeden birden çok öğe seçmek için birden çok onay kutusu içeren açılır liste oluşturma eğilimindedir. Aslında, Veri Doğrulama ile birden çok onay kutusu içeren bir liste oluşturamazsınız. Bu eğiticide, Excel'de birden çok onay kutusu içeren açılır liste oluşturmak için size iki yöntem göstereceğiz.

Birden çok onay kutusu içeren bir açılır liste oluşturmak için Liste Kutusu'nu kullanın
A: Kaynak verilerle bir liste kutusu oluşturun
B: Seçili öğeleri bulacağınız hücreyi adlandırın
C: Seçili öğelerin çıktısını almaya yardımcı olacak bir şekil ekleyin
Harika bir araçla onay kutuları içeren açılır listeyi kolayca oluşturun
Açılır liste için daha fazla öğretici ...


Birden çok onay kutusu içeren bir açılır liste oluşturmak için Liste Kutusu'nu kullanın

Aşağıda gösterilen ekran görüntüsü gibi, mevcut çalışma sayfasında, A2: A11 aralığındaki tüm isimler liste kutusunun kaynak verileri olacaktır. C4 hücresindeki düğmeye tıklamak seçili öğelerin çıktısını alabilir ve liste kutusundaki tüm seçili öğeler E4 hücresinde görüntülenecektir. Bunu başarmak için lütfen aşağıdaki işlemleri yapın.

A. Kaynak verilerle bir liste kutusu oluşturun

1. tık Geliştirici > Ekle > Liste Kutusu (Aktif X Kontrolü). Ekran görüntüsüne bakın:

2. Geçerli çalışma sayfasında bir liste kutusu çizin, sağ tıklayın ve ardından seçin Emlaklar sağ tıklama menüsünden.

3. içinde Emlaklar iletişim kutusu, aşağıdaki gibi yapılandırmanız gerekir.

  • 3.1 içinde ListeFillRange kutusuna listede görüntüleyeceğiniz kaynak aralığını girin (buraya aralığı giriyorum A2: A11);
  • 3.2 içinde Liste biçimi kutusunu seçin 1 - fmList Tarzı Seçeneği;
  • 3.3 içinde Çoklu seçim kutusunu seçin 1 - fmMultiSelectMulti;
  • 3.4 Kapatın Emlaklar iletişim kutusu. Ekran görüntüsüne bakın:

B: Seçili öğeleri bulacağınız hücreyi adlandırın

Tüm seçili öğeleri E4 gibi belirli bir hücreye çıkarmanız gerekirse, lütfen aşağıdaki işlemleri gerçekleştirin.

1. E4 hücresini seçin, girin Liste KutusuÇıktı içine isim Kutusu basın ve Keşfet tuşuna basın.

C. Seçili öğelerin çıktısını almaya yardımcı olacak bir şekil ekleyin

1. tık Ekle > Şekiller > Dikdörtgen. Ekran Bkz:

2. Çalışma sayfanıza bir dikdörtgen çizin (burada C4 hücresine dikdörtgen çiziyorum). Ardından dikdörtgeni sağ tıklayın ve Makro Ata sağ tıklama menüsünden.

3. içinde Makro Ata iletişim kutusunda, yeni düğmesine basın.

4. Açılışta Uygulamalar için Microsoft Visual Basic pencere, lütfen orijinal kodu değiştirin modül aşağıdaki VBA kodu ile pencere.

VBA kodu: Birden çok onay kutusu içeren bir liste oluşturun

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

Not: Kodda, Dikdörtgen1 şekil adıdır; Liste Kutusu1 liste kutusunun adıdır; Seçenekleri Seç ve Alım Seçenekleri şeklin görüntülenen metinleridir; ve Liste KutusuÇıktı çıktı hücresinin aralık adıdır. Bunları ihtiyaçlarınıza göre değiştirebilirsiniz.

5. Basın Ara Toplam + Q kapatmak için aynı anda tuşları Uygulamalar için Microsoft Visual Basic pencere.

6. Dikdörtgen düğmesine tıkladığınızda liste kutusu katlanacak veya genişletilecektir. Liste kutusu genişlediğinde, liste kutusundaki öğeleri kontrol edin ve ardından tüm seçili öğeleri E4 hücresine çıkarmak için dikdörtgeni tekrar tıklayın. Aşağıdaki demoya bakın:

7. Daha sonra çalışma kitabını bir Excel MacroEnable Çalışma Kitabı kodu gelecekte yeniden kullanmak için.


Harika bir araçla onay kutuları içeren açılır liste oluşturun

Yukarıdaki yöntem, kolayca işlenemeyecek kadar çok adımlıdır. İşte kesinlikle tavsiye ederim Onay Kutulu Açılır Liste yarar Kutools için Excel belirli bir aralıktaki onay kutuları, mevcut çalışma sayfası, mevcut çalışma kitabı veya ihtiyaçlarınıza göre açılan tüm çalışma kitaplarını içeren açılır listeyi kolayca oluşturmanıza yardımcı olmak için. Aşağıdaki demoya bakın:
Şimdi indirin ve deneyin! (30 günlük ücretsiz parkur)

Yukarıdaki demonun yanı sıra, bu görevi başarmak için bu özelliğin nasıl uygulanacağını gösteren adım adım bir kılavuz da sağlıyoruz. Lütfen aşağıdaki işlemleri yapın.

1. Veri doğrulama açılır listesini ayarladığınız çalışma sayfasını açın, Kutools > Açılır liste > Onay Kutulu Açılır Liste > Ayarlar. Ekran Bkz:

2. içinde Onay Kutuları Ayarları ile Açılır Liste iletişim kutusu, lütfen aşağıdaki gibi yapılandırın.

  • 2.1) içinde Uygula bölümünde, açılır listedeki öğeler için onay kutuları oluşturacağınız uygulama kapsamını belirtin. Bir belirtebilirsiniz belirli aralık, mevcut çalışma sayfası, mevcut çalışma kitabı or tüm açık çalışma kitapları senin ihtiyaçlarına göre.
  • 2.2) içinde Moda bölümünde, seçili öğelerin çıktısını almak istediğiniz stili seçin;
  • İşte alır değiştirmek örnek olarak, bunu seçerseniz, hücre değeri seçilen öğelere göre değiştirilecektir.
  • 2.3) içinde Separatör kutusuna, birden çok öğeyi ayırmak için kullanacağınız bir sınırlayıcı girin;
  • 2.4) içinde Metin yönü bölümünde ihtiyaçlarınıza göre bir metin yönü seçin;
  • 2.5) OK düğmesine basın.

3. Son adım, tıklayın Kutools > Açılır liste > Onay Kutulu Açılır Liste > Açılır Onay Kutuları Listesini Etkinleştir bu özelliği etkinleştirmek için.

Şu andan itibaren, belirli bir kapsamdaki açılır listeye sahip hücrelere tıkladığınızda, bir liste kutusu açılacaktır, lütfen aşağıda gösterilen demoda gösterildiği gibi hücreye çıktı vermek için onay kutularını işaretleyerek öğeleri seçin (Örnek olarak Değiştirme modunu alın ).

Bu özellikle ilgili daha fazla ayrıntı için, lütfen burayı ziyaret edin.

  Bu yardımcı programın ücretsiz denemesine (30 günlük) sahip olmak istiyorsanız, indirmek için lütfen tıklayınızve ardından yukarıdaki adımlara göre işlemi uygulamaya gidin.


İlgili yazılar:

Excel açılır listesine yazarken otomatik tamamlama
Büyük değerlere sahip bir veri doğrulama açılır listeniz varsa, yalnızca uygun olanı bulmak için listede aşağı kaydırmanız veya tüm kelimeyi doğrudan liste kutusuna yazmanız gerekir. Açılır listedeki ilk harfi yazarken otomatik tamamlamaya izin verme yöntemi varsa, her şey daha kolay hale gelecektir. Bu eğitim, sorunu çözme yöntemini sağlar.

Excel'de başka bir çalışma kitabından açılır liste oluşturun
Bir çalışma kitabındaki çalışma sayfaları arasında bir veri doğrulama açılır listesi oluşturmak oldukça kolaydır. Ancak, veri doğrulama için ihtiyacınız olan liste verileri başka bir çalışma kitabında bulunuyorsa, ne yapardınız? Bu öğreticide, Excel'deki başka bir çalışma kitabından açılır listenin nasıl oluşturulacağını ayrıntılı olarak öğreneceksiniz.

Excel'de aranabilir bir açılır liste oluşturun
Çok sayıda değeri olan bir açılır liste için, uygun olanı bulmak kolay bir iş değildir. Daha önce, açılır kutuya ilk harfi girerken otomatik tamamlama açılır listesi için bir yöntem getirmiştik. Otomatik tamamlama işlevinin yanı sıra, açılır listede uygun değerleri bulmada çalışma verimliliğini artırmak için açılır listeyi aranabilir hale de getirebilirsiniz. Açılır listeyi aranabilir hale getirmek için bu eğitimdeki yöntemi deneyin.

Excel açılır listesindeki değerleri seçerken diğer hücreleri otomatik olarak doldurun
B8: B14 hücre aralığındaki değerlere dayalı bir açılır liste oluşturduğunuzu varsayalım. Açılır listeden herhangi bir değeri seçtiğinizde, C8: C14 hücre aralığındaki karşılık gelen değerlerin seçili bir hücrede otomatik olarak doldurulmasını istersiniz. Sorunu çözmek için, bu eğitimdeki yöntemler size bir iyilik yapacaktır.

Açılır liste için daha fazla öğretici ...

En İyi Ofis Üretkenlik Araçları

🤖 Kutools AI Yardımcısı: Aşağıdakilere dayalı olarak veri analizinde devrim yaratın: Akıllı Yürütme   |  Kodunu oluşturun  |  Özel Formüller Oluşturun  |  Verileri Analiz Edin ve Grafikler Oluşturun  |  Kutools İşlevlerini Çağır...
Popüler Özellikler: Yinelenenleri Bul, Vurgula veya Tanımla   |  Boş Satırları Sil   |  Veri Kaybı Olmadan Sütunları veya Hücreleri Birleştirin   |   Formülsüz Tur ...
Süper Arama: Çoklu Ölçütlü VLookup    Çoklu Değer VLookup  |   Birden Çok Sayfada VLookup   |   Bulanık Arama ....
Gelişmiş Açılır Liste: Hızla Açılır Liste Oluşturun   |  Bağımlı Açılır Liste   |  Çoklu Seçim Açılır Liste ....
Sütun Yöneticisi: Belirli Sayıda Sütun Ekleme  |  Sütunları Taşı  |  Gizli Sütunların Görünürlük Durumunu Değiştir  |  Aralıkları ve Sütunları Karşılaştırın ...
Öne Çıkan Özellikler: Izgara Odağı   |  Tasarım görünümü   |   Büyük Formül Çubuğu    Çalışma Kitabı ve Sayfa Yöneticisi   |  Kaynak Kütüphanesi (Otomatik metin)   |  Tarih Seçici   |  Çalışma Sayfalarını Birleştirin   |  Hücreleri Şifrele/Şifresini Çöz    E-postaları Listeye Göre Gönder   |  Süper Filtre   |   Özel Filtre (kalın/italik/üstü çizili filtre...) ...
En İyi 15 Araç Seti12 Metin Tools (Metin ekle, Karakterleri Kaldır, ...)   |   50+ Grafik Türleri (Gantt şeması, ...)   |   40+ Pratik Formüller (Yaşı doğum gününe göre hesapla, ...)   |   19 sokma Tools (QR Kodunu Girin, Yoldan Resim Ekle, ...)   |   12 Dönüştürme Tools (Sayılardan Kelimelere, Para Birimi Dönüştürme, ...)   |   7 Birleştir ve Böl Tools (Gelişmiş Kombine Satırları, Bölünmüş hücreler, ...)   |   ... ve dahası

Kutools for Excel ile Excel Becerilerinizi Güçlendirin ve Daha Önce Hiç Olmadığı Gibi Verimliliği Deneyimleyin. Kutools for Excel, Üretkenliği Artırmak ve Zamandan Tasarruf Etmek için 300'den Fazla Gelişmiş Özellik Sunar.  En Çok İhtiyacınız Olan Özelliği Almak İçin Buraya Tıklayın...

Açıklama


Office Tab, Office'e Sekmeli Arayüz Getirir ve İşinizi Çok Daha Kolay Hale Getirir

  • Word, Excel, PowerPoint'te sekmeli düzenlemeyi ve okumayı etkinleştirin, Publisher, Access, Visio ve Project.
  • Yeni pencereler yerine aynı pencerenin yeni sekmelerinde birden çok belge açın ve oluşturun.
  • Üretkenliğinizi% 50 artırır ve her gün sizin için yüzlerce fare tıklamasını azaltır!
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