Note: The other languages of the website are Google-translated. Back to English
Mewngofnodi  \/ 
x
or
x
Cofrestru  \/ 
x

or

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 ListFillRange 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 ListStyle 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 ListBoxOutput 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 Newydd 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 a Dewisiadau Pickup yw testunau arddangos y siâp; a'r ListBoxOutput 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 rhoi cynnig 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 ...


Yr Offer Cynhyrchedd Swyddfa Gorau

Mae Kutools for Excel yn Datrys y rhan fwyaf o'ch Problemau, ac yn Cynyddu Eich Cynhyrchedd 80%

  • Ailddefnyddio: Mewnosod yn gyflym fformwlâu cymhleth, siartiau ac unrhyw beth rydych chi wedi'i ddefnyddio o'r blaen; Amgryptio Celloedd gyda chyfrinair; Creu Rhestr Bostio ac anfon e-byst ...
  • Bar Fformiwla Gwych (golygu llinellau lluosog o destun a fformiwla yn hawdd); Cynllun Darllen (darllen a golygu nifer fawr o gelloedd yn hawdd); Gludo i'r Ystod Hidlo...
  • Uno Celloedd / Rhesi / Colofnau heb golli Data; Cynnwys Celloedd Hollt; Cyfuno Rhesi / Colofnau Dyblyg... Atal Celloedd Dyblyg; Cymharwch y Meysydd...
  • Dewiswch Dyblyg neu Unigryw Rhesi; Dewiswch Blank Rows (mae pob cell yn wag); Darganfyddiad Gwych a Darganfyddiad Niwlog mewn Llawer o Lyfrau Gwaith; Dewis ar Hap ...
  • Copi Union Celloedd Lluosog heb newid cyfeirnod fformiwla; Auto Creu Cyfeiriadau i Daflenni Lluosog; Mewnosod Bwledi, Blychau Gwirio a mwy ...
  • Testun Detholiad, Ychwanegu Testun, Tynnu yn ôl Swydd, Tynnwch y Gofod; Creu ac Argraffu Subtotals Paging; Trosi rhwng Cynnwys a Sylwadau Celloedd...
  • Hidlo Super (arbed a chymhwyso cynlluniau hidlo i ddalenni eraill); Trefnu Uwch yn ôl mis / wythnos / dydd, amlder a mwy; Hidlo Arbennig gan feiddgar, italig ...
  • Cyfuno Llyfrau Gwaith a Thaflenni Gwaith; Uno Tablau yn seiliedig ar golofnau allweddol; Rhannwch Ddata yn Daflenni Lluosog; Trosi Swp xls, xlsx a PDF...
  • Mwy na 300 o nodweddion pwerus. Yn cefnogi Swyddfa / Excel 2007-2019 a 365. Yn cefnogi pob iaith. Defnydd hawdd yn eich menter neu sefydliad. Nodweddion llawn treial am ddim 30 diwrnod. Gwarant arian yn ôl 60 diwrnod.
tab kte 201905

Mae Tab Office yn Dod â rhyngwyneb Tabbed i'r Swyddfa, a 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!
gwaelod officetab
Say something here...
symbols left.
You are guest
or post as a guest, but your post won't be published automatically.
Loading comment... The comment will be refreshed after 00:00.
  • To post as a guest, your comment is unpublished.
    faez · 14 days ago
    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!
    • To post as a guest, your comment is unpublished.
      crystal · 9 days ago
      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
  • To post as a guest, your comment is unpublished.
    Eloi · 25 days ago
    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 ?

    • To post as a guest, your comment is unpublished.
      crystal · 9 days ago
      Hi Eloi,
      No separator is displayed when you select only one item in the list.
  • To post as a guest, your comment is unpublished.
    Morgane K · 6 months ago
    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
  • To post as a guest, your comment is unpublished.
    Gowtham · 11 months ago
    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
    • To post as a guest, your comment is unpublished.
      crystal · 11 months ago
      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).
      • To post as a guest, your comment is unpublished.
        minapnh · 2 months ago
        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?
      • To post as a guest, your comment is unpublished.
        Mina · 2 months ago
        Hi Crystal, Even After your tip I am getting same error as Gowtham.

  • To post as a guest, your comment is unpublished.
    fbjr · 1 years ago
    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
  • To post as a guest, your comment is unpublished.
    ben · 1 years ago
    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.
    • To post as a guest, your comment is unpublished.
      crystal · 1 years ago
      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.
  • To post as a guest, your comment is unpublished.
    Tom · 1 years ago
    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 :)
    • To post as a guest, your comment is unpublished.
      crystal · 1 years ago
      Hi Tom,
      Please save the workbook as an "Excel MacroEnable Workbook" and then send this .xlsm file to your colleague.
      • To post as a guest, your comment is unpublished.
        Tom · 1 years ago
        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

        • To post as a guest, your comment is unpublished.
          crystal · 1 years ago
          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
          • To post as a guest, your comment is unpublished.
            Tom · 1 years ago
            Now it's working perfectly.
            Many thanks for your help
  • To post as a guest, your comment is unpublished.
    Lesley Cantu · 1 years ago
    Hi! What would I need to do if I want to place multiple drop down lists on one sheet?
    • To post as a guest, your comment is unpublished.
      crystal · 1 years ago
      Good day,
      You can browse the below page to find the solution.
      https://www.extendoffice.com/documents/excel/915-excel-insert-drop-down-list.html

  • To post as a guest, your comment is unpublished.
    Elston Hynd · 1 years ago
    Hi, I have used your code below to create a multiple drop down box in excel that is also able to work when the worksheet is in protected mode. However, it only works in the one ListOutputBox (cell O38). I want it to work in a range of cells (O38:O239). What do I need to change?


    Sub Rectangle3_Click()
    'Updated by Extendoffice 20191114
    Dim xSelShp As Shape, xSelLst As Variant, i As Integer
    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"
    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
  • To post as a guest, your comment is unpublished.
    Chez Baker · 2 years ago
    How would you make the output names display to different cells instead of being put together in one? Thank you!
    • To post as a guest, your comment is unpublished.
      crystal · 2 years ago
      Hi Chez Baker,
      With the below VBA code, you can fill the multiselection in different cells on the same row. Please have a try.

      Sub Rectangle2_Click()
      'Updated by Extendoffice 20190924
      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
  • To post as a guest, your comment is unpublished.
    Gustav Benz · 2 years ago
    Thank you so much for this, now how do I put multiple checkbox menus with different macros (as this one only applies to adding one in the excel file)?
    • To post as a guest, your comment is unpublished.
      crystal · 2 years ago
      Good day,
      Sorry can't help you with that. Thank you for your comment.
  • To post as a guest, your comment is unpublished.
    Jorge Valdes · 2 years ago
    hello Crystal, how Can I use this VBA code in order to fill diferents cells, this article is only to fill the multiselection in the same cell... could you help me please?
    • To post as a guest, your comment is unpublished.
      crystal · 2 years ago
      Hi Jorge Valdes,
      With the below VBA code, you can fill the multiselection in different cells on the same row. Please have a try.

      Sub Rectangle2_Click()
      'Updated by Extendoffice 20190924
      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
      • To post as a guest, your comment is unpublished.
        Amy · 1 years ago
        too cool! Thank you!
  • To post as a guest, your comment is unpublished.
    Jimmy · 2 years ago
    Como puedo replicar éste ejercicio en las filas inferiores ?
    How can I replicate this exercise in the rows below?
  • To post as a guest, your comment is unpublished.
    alcatel · 2 years ago
    HELP!!! how output in different ranges (vertically)?
    • To post as a guest, your comment is unpublished.
      Jea Perez · 1 years ago
      Sub Rectangle2_Click()
      'Updated by Extendoffice 20190924
      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(1, 0)
      End If
      Next I
      End If
      End Sub
  • To post as a guest, your comment is unpublished.
    alcat · 2 years ago
    Добрый день! Прошу помочь.
    Как сделать так чтобы каждое значение выходило на новой клетке? чтобы по выходило по вертикали?
  • To post as a guest, your comment is unpublished.
    binoy · 2 years ago
    It is working fine, thanks a lot for your help. I have one issue here is that, all the output is coming in the same cell E4, how can we get the output in different cells Eg: output for C4 in E4, C5 in E5 ,C6 in E6 etc.
    • To post as a guest, your comment is unpublished.
      crystal · 2 years ago
      Good Day,
      The problem you mentioned can't be solve yet.
  • To post as a guest, your comment is unpublished.
    LizKats · 3 years ago
    Hello,

    I am wondering if there is a way to direct the pickup options to more than one cell (not just E4), or make the selections a dropdown checklist so that I can select multiple options off a checklist, but do so repeatedly and independent of the other selections I've made. For example, how would I go about using the same list of pickup options to input a different selection of items to E5, E6, E7, etc. from the same pickup list.

    Thank you
    • To post as a guest, your comment is unpublished.
      crystal · 1 years ago
      Hi LizKats,
      Please try the below code. Hope I can help. Thank you.

      Sub Rectangle2_Click()
      'Updated by Extendoffice 20200529
      Dim xSelShp As Shape, xSelLst As Variant, i As Integer
      Set xSelShp = ActiveSheet.Shapes(Application.Caller)
      Set xLstBox = ActiveSheet.ListBox1
      Dim xRg As Range
      Dim xCount, xFNum, xR, xC As Integer
      Dim xStr As String
      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")
      xCount = xLstBox.ListCount - 1
      xStr = ""
      For i = xLstBox.ListCount - 1 To 0 Step -1
      If xLstBox.Selected(i) = True Then
      xStr = xLstBox.List(i) & ";" & xStr
      End If
      Next i

      If xRg.Value = "" Then
      xRg.Value = xStr
      Else
      Set xRg = xRg.Offset(1, 0)
      Do While xRg.Value <> ""
      Set xRg = xRg.Offset(1, 0)
      Loop
      xRg.Value = xStr
      End If
      End If
      End Sub
  • To post as a guest, your comment is unpublished.
    mark · 3 years ago
    amazing its working but i have one issue after i save the file and open it again the all check from the checkbox list is all gone
    can you help me to this one thank you so much
    • To post as a guest, your comment is unpublished.
      crystal · 3 years ago
      Dear mark,
      We have published an article "How to save or retain selections of ActiveX list boxes in Excel?" which introduces method of saving the selections of list boxes after close and reopen the workbook.
      You can follow this link to get more information: https://www.extendoffice.com/documents/excel/5051-excel-listbox-save-selection.html
    • To post as a guest, your comment is unpublished.
      mark · 3 years ago
      also, it changes the size of the list box and shape always after save and open again the file if someone has a solution for this issue please help me

      thank you so much
  • To post as a guest, your comment is unpublished.
    Angel · 3 years ago
    AMAZING its working but after i close the excel and open it again the check from the checkbox is gone so if i click the button all list will be gone any solution for this
    please someone help me
    Thank you so much in advanced
    • To post as a guest, your comment is unpublished.
      crystal · 3 years ago
      Dear Angel,
      We have published an article "How to save or retain selections of ActiveX list boxes in Excel?" which introduces method of saving the selections of list boxes after close and reopen the workbook.
      You can follow this link to get more information: https://www.extendoffice.com/documents/excel/5051-excel-listbox-save-selection.html
  • To post as a guest, your comment is unpublished.
    milindghadi07@gmail.com · 3 years ago
    i want automatically update names in different columns. is it possible if possible kindly share me the code.
  • To post as a guest, your comment is unpublished.
    · 3 years ago
    "I have created a file using ActiveX list box as you are explained,there i have entered some data and and added some properties too.i have checked some data using the checkbox in the list ,and saved & exit from the file. But while re-opening the file it's not showing any checked data..can anybody give me a suggestion to save those updationes."
    Can anybody help me please.
    • To post as a guest, your comment is unpublished.
      crystal · 3 years ago
      Besides, you need to save the workbook as an Excel Macro-enabled Workbook, and activate the code every time you change the selections of the list box.
    • To post as a guest, your comment is unpublished.
      crystal · 3 years ago
      Good Day,
      Please place the below VBA code into ThisWorkbook code window.
      In the code, Sheet6 is the default name of the worksheet which contains the List Box you want to retain the selections as below screenshot shown. And ListBox1 is the name of the list box. Please change them as you need.

      Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
      Call SaveSelections
      End Sub

      Private Sub Workbook_Open()
      Call RestoreSelections
      End Sub

      Private Sub SaveSelections()

      Dim arr() As Variant, i As Long, j As Long

      With Sheet6.OLEObjects("ListBox1").Object
      If .ListIndex > 0 Then
      For i = 0 To .ListCount - 1
      If .Selected(i) Then
      j = j + 1
      ReDim Preserve arr(1 To j)
      arr(j) = i
      End If
      Next
      Names.Add Name:="Selections", RefersTo:=arr, Visible:=False
      End If
      End With

      End Sub

      Private Sub RestoreSelections()

      Dim arr As Variant, i As Integer

      arr = [Selections]

      With Sheet6.OLEObjects("ListBox1").Object
      For i = 1 To UBound(arr)
      .Selected(arr(i)) = True
      Next
      End With

      End Sub
      • To post as a guest, your comment is unpublished.
        · 3 years ago
        Thank you for the reply sir ,but its not working in the case of my file , can u please send your mail id , so that i can mail you my file to you.
        Thanks in advance
        • To post as a guest, your comment is unpublished.
          crystal · 3 years ago
          Dear manjusha isac,
          Please send your file to zxm@addin99.com. Hope I can help.
  • To post as a guest, your comment is unpublished.
    amit7138@yahoo.com · 3 years ago
    Work perfectly as per the Instructions. But, How can I use this on a Protected sheet. Currently If I use this after protecting the sheet It gives me and error "Run-time error '-2147024809 (80070057)': The Specified Value is out of Range"
    • To post as a guest, your comment is unpublished.
      crystal · 3 years ago
      Dear Amit Sood,
      Before protecting the worksheet, please format the Output cell as unlocked and then apply the below VBA code. Thank you for your comment.

      Sub Rectangle2_Click()
      Dim xSelShp As Shape, xSelLst As Variant, I As Integer
      On Error Resume Next
      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"
      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
  • To post as a guest, your comment is unpublished.
    Amit Sood · 3 years ago
    It works perfectly as per the instructions, However if I protect the sheet it gives and error. Any workaround for this?
  • To post as a guest, your comment is unpublished.
    gohardrgohome · 4 years ago
    I'm a newbie to this but can anyone tell me how to create a mult-selection ListBox that will open, e.g., when I select a name. I want the list box to fit in a single.
    EXAMPLE: I have a list of names with contact info, etc. I want to create a duplicate Listbox for each name in my list. I'd like it to open automatically when I select a name and collapse back into the cell when I go to another row of info. Please advise. Thanks in advance.
    • To post as a guest, your comment is unpublished.
      crystal · 4 years ago
      Dear Randy,
      Sorry can't solve this probem.
  • To post as a guest, your comment is unpublished.
    MartSkot · 4 years ago
    Thank you! It is great and it works!
  • To post as a guest, your comment is unpublished.
    VBR looser · 4 years ago
    Once the output is done and press the button again, the previous selected items in the list box cannot be changed. How to resolve?
  • To post as a guest, your comment is unpublished.
    gimmic · 4 years ago
    could you please explain how can i easily copy this listbox for 100 rows? (seperate listboxes for each of 100 rows)
  • To post as a guest, your comment is unpublished.
    gimmic · 4 years ago
    Hello
    How can copy this listbox for multi cells. Just copy and paste is not working. Could you please explain for example in each cells (E5,E6,E7,E8,...) how can i put this selection box?
  • To post as a guest, your comment is unpublished.
    harshit · 4 years ago
    can you please explain how you have added ListBoxOutput on E4 cell
  • To post as a guest, your comment is unpublished.
    Chris M · 4 years ago
    This is just what i have been looking fo, is there a modification to the code that will put the next selection from the listbox in the next line. for eg
    one
    two
    three
    Instead of :
    one, two, three
  • To post as a guest, your comment is unpublished.
    Chris M · 4 years ago
    This is exactly what I have been looking for, can the code be modified to allow the selected data to display in separate cells down the column? so instead of:
    Monday, Tuesday, Wednesday,
    display as.
    Monday
    Tuesday
    Wednesday
  • To post as a guest, your comment is unpublished.
    Gazali Yakubu · 5 years ago
    This is fantastic. But will be better if the multi selection can be placed at where the cursor is active. Not necessarily what the code specifies.