Skip i'r prif gynnwys

Sut i greu gwymplen gyda blychau gwirio lluosog yn Excel?

Mae llawer o ddefnyddwyr Excel yn tueddu i greu gwymplen gyda blychau gwirio lluosog er mwyn dewis nifer o eitemau o'r rhestr bob tro. Mewn gwirionedd, ni allwch greu rhestr gyda blychau gwirio lluosog gyda Dilysu Data. Yn y tiwtorial hwn, rydyn ni'n mynd i ddangos dau ddull i chi greu gwymplen gyda blychau gwirio lluosog yn Excel.

Defnyddiwch Blwch Rhestr i greu rhestr ostwng gyda blychau gwirio lluosog
A: Creu blwch rhestr gyda data ffynhonnell
B: Enwch y gell y byddwch chi'n dod o hyd i'r eitemau a ddewiswyd
C: Mewnosod siâp i helpu i allbwn yr eitemau a ddewiswyd
Yn hawdd creu rhestr ostwng gyda blychau gwirio gydag offeryn anhygoel
Mwy o sesiynau tiwtorial ar gyfer y gwymplen ...


Defnyddiwch Blwch Rhestr i greu rhestr ostwng gyda blychau gwirio lluosog

Fel islaw'r screenshot a ddangosir, yn y daflen waith gyfredol, yr holl enwau yn ystod A2: A11 fydd data ffynhonnell y blwch rhestr. Gall cliciwch ar y botwm yng nghell C4 allbwn yr eitemau a ddewiswyd, a bydd yr holl eitemau a ddewiswyd yn y blwch rhestr yn cael eu harddangos yng nghell E4. I gyflawni hyn, gwnewch fel a ganlyn.

A. Creu blwch rhestr gyda data ffynhonnell

1. Cliciwch Datblygwr > Mewnosod > Blwch Rhestr (Rheoli X Gweithredol). Gweler y screenshot:

2. Lluniwch flwch rhestr yn y daflen waith gyfredol, cliciwch ar y dde ac yna dewiswch Eiddo o'r ddewislen clicio ar y dde.

3. Yn y Eiddo blwch deialog, mae angen i chi ffurfweddu fel a ganlyn.

  • 3.1 Yn y RhestrFillRage blwch, nodwch yr ystod ffynhonnell y byddwch chi'n ei harddangos yn y rhestr (dyma fi'n nodi'r ystod A2: A11);
  • 3.2 Yn y RhestrSteil blwch, dewiswch 1 - StyleOption fmList;
  • 3.3 Yn y Aml-ddewis blwch, dewiswch 1 - fmMultiSelectMulti;
  • 3.4 Caewch y Eiddo blwch deialog. Gweler y screenshot:

B: Enwch y gell y byddwch chi'n dod o hyd i'r eitemau a ddewiswyd

Os oes angen i chi allbwn yr holl eitemau a ddewiswyd i mewn i gell benodol fel E4, gwnewch fel a ganlyn.

1. Dewiswch y gell E4, nodwch Allbwn ListBox i mewn i'r Blwch Enw a gwasgwch y Rhowch allweddol.

C. Mewnosod siâp i helpu i allbwn yr eitemau a ddewiswyd

1. Cliciwch Mewnosod > Siapiau > Petryal. Gweler y screenshot:

2. Tynnwch betryal yn eich taflen waith (dyma fi'n llunio'r petryal yng nghell C4). Yna cliciwch ar y dde ar y petryal a dewis Neilltuo Macro o'r ddewislen clicio ar y dde.

3. Yn y Neilltuo Macro blwch deialog, cliciwch y Nghastell Newydd Emlyn botwm.

4. Yn yr agoriad Microsoft Visual Basic ar gyfer Ceisiadau ffenestr, disodli'r cod gwreiddiol yn y Modiwlau ffenestr gyda'r cod VBA isod.

Cod VBA: Creu rhestr gyda blychau gwirio lluosog

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

Nodyn: Yn y cod, Petryal1 yw enw'r siâp; RhestrBox1 yw enw'r blwch rhestr; Dewiswch Opsiynau ac Dewisiadau Pickup yw testunau arddangos y siâp; a'r Allbwn ListBox yw enw amrediad y gell allbwn. Gallwch eu newid yn seiliedig ar eich anghenion.

5. Gwasgwch Alt + Q allweddi ar yr un pryd i gau'r Microsoft Visual Basic ar gyfer Ceisiadau ffenestr.

6. Bydd clic ar y botwm petryal yn plygu neu'n ehangu'r blwch rhestr. Pan fydd y blwch rhestr yn ehangu, gwiriwch yr eitemau yn y blwch rhestr, ac yna cliciwch y petryal eto i allbwn yr holl eitemau a ddewiswyd i gell E4. Gweler isod demo:

7. Ac yna arbedwch y llyfr gwaith fel Llyfr Gwaith Excel MacroEnable am ailddefnyddio'r cod yn y dyfodol.


Creu rhestr ostwng gyda blychau gwirio gydag offeryn anhygoel

Mae'r dull uchod yn rhy amlbwrpas i'w drin yn hawdd. Yma yn argymell yn fawr y Rhestr ostwng gyda Blychau Gwirio cyfleustodau Kutools ar gyfer Excel i'ch helpu chi i greu rhestr ostwng yn hawdd gyda blychau gwirio mewn ystod benodol, taflen waith gyfredol, llyfr gwaith cyfredol neu'r holl lyfrau gwaith a agorwyd yn seiliedig ar eich anghenion. Gweler y demo isod:
Dadlwythwch a rhowch gynnig arni nawr! (Llwybr am ddim 30 diwrnod)

Heblaw am y demo uchod, rydym hefyd yn darparu canllaw cam wrth gam i ddangos sut i gymhwyso'r nodwedd hon i gyflawni'r dasg hon. Gwnewch fel a ganlyn.

1. Agorwch y daflen waith rydych chi wedi'i gosod yn y gwymplen dilysu data, cliciwch Kutools > Rhestr Gollwng > Rhestr ostwng gyda Blychau Gwirio > Gosodiadau. Gweler y screenshot:

2. Yn y Rhestr Gollwng Ffraethineb Gosodiadau Blychau Gwirio blwch deialog, ffurfweddwch fel a ganlyn.

  • 2.1) Yn y Gwnewch gais i adran, nodwch y cwmpas ymgeisio lle byddwch chi'n creu blychau gwirio ar gyfer eitemau ar y gwymplen. Gallwch chi nodi a ystod benodol, taflen waith gyfredol, llyfr gwaith cyfredol or pob llyfr gwaith wedi'i agor yn seiliedig ar eich anghenion.
  • 2.2) Yn y modd adran, dewiswch arddull rydych chi am allbwn yr eitemau a ddewiswyd;
  • Yma yn cymryd y Addasu opsiwn fel enghraifft, os dewiswch hyn, bydd gwerth y gell yn cael ei newid yn seiliedig ar yr eitemau a ddewiswyd.
  • 2.3) Yn y gwahanydd blwch, nodwch amffinydd y byddwch chi'n ei ddefnyddio i wahanu'r eitemau lluosog;
  • 2.4) Yn y Cyfeiriad Testun adran, dewiswch gyfeiriad testun yn seiliedig ar eich anghenion;
  • 2.5) Cliciwch y OK botwm.

3. Y cam olaf, cliciwch Kutools > Rhestr Gollwng > Rhestr ostwng gyda Blychau Gwirio > Galluogi Rhestr Gollwng o flychau gwirio i actifadu'r nodwedd hon.

O hyn ymlaen, pan gliciwch y celloedd gyda gwymplen mewn cwmpas penodol, bydd blwch rhestr yn ymddangos, dewiswch eitemau trwy wirio'r blychau gwirio i'w hallbwn i'r gell fel y dangosir isod (Cymerwch y modd Newid fel enghraifft ).

Am fwy o fanylion am y nodwedd hon, ewch yma.

  Os ydych chi am gael treial am ddim (30 diwrnod) o'r cyfleustodau hwn, cliciwch i'w lawrlwytho, ac yna ewch i gymhwyso'r llawdriniaeth yn ôl y camau uchod.


Erthyglau cysylltiedig:

Yn awtomataidd wrth deipio rhestr ostwng Excel
Os oes gennych chi gwymplen dilysu data gyda gwerthoedd mawr, mae angen i chi sgrolio i lawr yn y rhestr dim ond er mwyn dod o hyd i'r un iawn, neu deipio'r gair cyfan yn y blwch rhestr yn uniongyrchol. Os oes dull ar gyfer caniatáu i gwblhau auto wrth deipio'r llythyren gyntaf yn y gwymplen, bydd popeth yn dod yn haws. Mae'r tiwtorial hwn yn darparu'r dull i ddatrys y broblem.

Creu rhestr ostwng o lyfr gwaith arall yn Excel
Mae'n eithaf hawdd creu gwymplen dilysu data ymhlith taflenni gwaith mewn llyfr gwaith. Ond os yw'r data rhestr sydd ei angen arnoch ar gyfer dilysu'r data yn lleoli mewn llyfr gwaith arall, beth fyddech chi'n ei wneud? Yn y tiwtorial hwn, byddwch yn dysgu sut i greu rhestr gollwng o lyfr gwaith arall yn Excel yn fanwl.

Creu rhestr ostwng y gellir ei chwilio yn Excel
Ar gyfer rhestr ostwng sydd â nifer o werthoedd, nid yw dod o hyd i un iawn yn waith hawdd. Yn flaenorol rydym wedi cyflwyno dull o gwblhau rhestr ostwng yn awtomatig wrth nodi'r llythyr cyntaf yn y gwymplen. Heblaw am y swyddogaeth awtocomplete, gallwch hefyd wneud y rhestr ostwng yn chwiliadwy am wella'r effeithlonrwydd gweithio wrth ddod o hyd i werthoedd cywir yn y gwymplen. Ar gyfer chwilio rhestr ostwng, rhowch gynnig ar y dull yn y tiwtorial hwn.

Auto poblogi celloedd eraill wrth ddewis gwerthoedd yn rhestr ostwng Excel
Gadewch i ni ddweud eich bod wedi creu rhestr ostwng yn seiliedig ar y gwerthoedd yn ystod celloedd B8: B14. Pan ddewiswch unrhyw werth yn y gwymplen, rydych chi am i'r gwerthoedd cyfatebol yn ystod celloedd C8: C14 gael eu poblogi'n awtomatig mewn cell ddethol. Ar gyfer datrys y broblem, bydd y dulliau yn y tiwtorial hwn yn ffafrio chi.

Mwy o sesiynau tiwtorial ar gyfer y gwymplen ...

Offer Cynhyrchiant Swyddfa Gorau

🤖 Kutools AI Aide: Chwyldro dadansoddi data yn seiliedig ar: Cyflawniad Deallus   |  Cynhyrchu Cod  |  Creu Fformiwlâu Personol  |  Dadansoddi Data a Chynhyrchu Siartiau  |  Invoke Swyddogaethau Kutools...
Nodweddion Poblogaidd: Darganfod, Amlygu neu Adnabod Dyblygiadau   |  Dileu Rhesi Gwag   |  Cyfuno Colofnau neu Gelloedd heb Colli Data   |   Rownd heb Fformiwla ...
Super-edrych: VLookup Meini Prawf Lluosog    VLookup Gwerth Lluosog  |   VLookup Ar Draws Taflenni Lluosog   |   Edrych Niwlog ....
Rhestr gwympo Uwch: Creu Rhestr Gollwng yn Gyflym   |  Rhestr Gollwng Dibynnol   |  Rhestr Gollwng Aml-ddewis ....
Rheolwr Colofn: Ychwanegu Nifer Penodol o Golofnau  |  Symud Colofnau  |  Toglo Statws Gwelededd Colofnau Cudd  |  Cymharwch Ystodau a Cholofnau ...
Nodweddion dan Sylw: Ffocws ar y Grid   |  Golwg Dylunio   |   Bar Fformiwla Mawr    Rheolwr Llyfr Gwaith a Thaflen   |  Llyfrgell Adnoddau (Testun Auto)   |  Dewiswr Dyddiad   |  Cyfuno Taflenni Gwaith   |  Amgryptio/Dadgryptio Celloedd    Anfon E-byst trwy Restr   |  Hidlo Super   |   Hidlo Arbennig (hidlo mewn print trwm/italig/strikethrough...) ...
15 Set Offer Gorau12 Testun offer (Ychwanegu Testun, Dileu Cymeriadau,...)   |   50 + Siart Mathau (Siart Gantt,...)   |   40+ Ymarferol Fformiwlâu (Cyfrifwch oedran yn seiliedig ar ben-blwydd,...)   |   19 mewnosod offer (Mewnosod Cod QR, Mewnosod Llun o'r Llwybr,...)   |   12 Trosi offer (Rhifau i Eiriau, Trosi arian cyfred,...)   |   7 Uno a Hollti offer (Rhesi Cyfuno Uwch, Celloedd Hollt,...)   |   ... a mwy

Supercharge Eich Sgiliau Excel gyda Kutools ar gyfer Excel, a Phrofiad Effeithlonrwydd Fel Erioed Erioed. Kutools ar gyfer Excel Yn Cynnig Dros 300 o Nodweddion Uwch i Hybu Cynhyrchiant ac Arbed Amser.  Cliciwch Yma i Gael Y Nodwedd Sydd Ei Angen Y Mwyaf...

Disgrifiad


Mae Office Tab yn dod â rhyngwyneb Tabbed i Office, ac yn Gwneud Eich Gwaith yn Haws o lawer

  • Galluogi golygu a darllen tabbed yn Word, Excel, PowerPoint, Cyhoeddwr, Mynediad, Visio a Phrosiect.
  • Agor a chreu dogfennau lluosog mewn tabiau newydd o'r un ffenestr, yn hytrach nag mewn ffenestri newydd.
  • Yn cynyddu eich cynhyrchiant 50%, ac yn lleihau cannoedd o gliciau llygoden i chi bob dydd!
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