메인 컨텐츠로 가기

Excel에서 여러 확인란이있는 드롭 다운 목록을 만드는 방법은 무엇입니까?

많은 Excel 사용자는 시간당 목록에서 여러 항목을 선택하기 위해 여러 확인란이있는 드롭 다운 목록을 만드는 경향이 있습니다. 실제로 데이터 유효성 검사로 여러 확인란이있는 목록을 만들 수 없습니다. 이 자습서에서는 Excel에서 여러 확인란이있는 드롭 다운 목록을 만드는 두 가지 방법을 보여줍니다.

목록 상자를 사용하여 여러 확인란이있는 드롭 다운 목록 만들기
A : 소스 데이터로 목록 상자 만들기
B : 선택한 항목을 찾을 셀 이름
C : 선택한 항목을 출력하는 데 도움이되는 도형 삽입
놀라운 도구로 체크 박스가있는 드롭 다운 목록을 쉽게 생성
드롭 다운 목록에 대한 추가 자습서 ...


목록 상자를 사용하여 여러 확인란이있는 드롭 다운 목록 만들기

아래 스크린 샷과 같이 현재 워크 시트에서 A2 : A11 범위의 모든 이름이 목록 상자의 원본 데이터가됩니다. C4 셀의 버튼을 클릭하면 선택한 항목을 출력 할 수 있으며 목록 상자에서 선택한 모든 항목은 E4 셀에 표시됩니다. 이를 위해 다음과 같이하십시오.

A. 소스 데이터가있는 목록 상자 만들기

1. 클릭 개발자 > 끼워 넣다 > 목록 상자 (Active X 컨트롤). 스크린 샷보기 :

2. 현재 워크 시트에 목록 상자를 그리고 마우스 오른쪽 단추로 클릭 한 다음 등록 오른쪽 클릭 메뉴에서.

3. 에서 등록 대화 상자에서 다음과 같이 구성해야합니다.

  • 3.1에서 목록 채우기 범위 상자에 목록에 표시 할 소스 범위를 입력합니다 (여기서는 범위를 입력합니다 A2 : A11);
  • 3.2에서 목록 스타일 상자, 선택 1-fmList StyleOption;
  • 3.3에서 다중 선택 상자, 선택 1 - fmMultiSelectMulti;
  • 3.4 닫기 등록 대화 상자. 스크린 샷보기 :

B : 선택한 항목을 찾을 셀 이름

선택한 모든 항목을 E4와 같은 지정된 셀에 출력해야하는 경우 다음과 같이하십시오.

1. E4 셀을 선택하고 목록 상자 출력이름 상자 그리고 엔터 버튼 키.

C. 선택한 항목을 출력하는 데 도움이되는 도형 삽입

1. 클릭 끼워 넣다 > 모양 > 직사각형. 스크린 샷을 참조하십시오 :

2. 워크 시트에 사각형을 그립니다 (여기서는 C4 셀에 사각형을 그립니다). 그런 다음 직사각형을 마우스 오른쪽 버튼으로 클릭하고 매크로 지정 오른쪽 클릭 메뉴에서.

3. 에서 매크로 지정 대화 상자에서 신제품 버튼을 클릭합니다.

4. 오프닝에서 응용 프로그램 용 Microsoft Visual Basic 창에서 원래 코드를 바꾸십시오. 모듈 아래 VBA 코드로 창.

VBA 코드 : 여러 확인란이있는 목록 만들기

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

참고 : 코드에서 직사각형 1 모양 이름입니다. ListBox1 목록 상자의 이름입니다. 옵션 선택픽업 옵션 모양의 표시된 텍스트입니다. 그리고 목록 상자 출력 출력 셀의 범위 이름입니다. 필요에 따라 변경할 수 있습니다.

5. 프레스 다른 + Q 키를 동시에 닫아 응용 프로그램 용 Microsoft Visual Basic 창.

6. 사각형 버튼을 클릭하면 목록 상자가 접히거나 확장됩니다. 목록 상자가 확장되면 목록 상자의 항목을 확인한 다음 사각형을 다시 클릭하여 선택한 모든 항목을 셀 E4로 출력합니다. 아래 데모를 참조하십시오.

7. 그런 다음 통합 문서를 Excel MacroEnable 통합 문서 나중에 코드를 재사용하기 위해.


놀라운 도구로 확인란이있는 드롭 다운 목록 만들기

위의 방법은 너무 다단계이므로 쉽게 처리 할 수 ​​없습니다. 여기에 적극 추천합니다 확인란이있는 드롭 다운 목록 ~의 유용성 용 Kutools 뛰어나다 필요에 따라 지정된 범위, 현재 워크 시트, 현재 통합 문서 또는 열려있는 모든 통합 문서의 확인란이있는 드롭 다운 목록을 쉽게 만들 수 있습니다. 아래 데모를 참조하십시오.
지금 다운로드하여 사용해 보세요! (30일 무료 트레일)

위의 데모 외에도이 작업을 수행하기 위해이 기능을 적용하는 방법을 보여주는 단계별 가이드도 제공합니다. 다음과 같이하십시오.

1. 데이터 유효성 검사 드롭 다운 목록을 설정 한 워크 시트를 열고 쿠툴 > 드롭 다운 목록 > 확인란이있는 드롭 다운 목록 > 설정. 스크린 샷을 참조하십시오 :

2. 에서 확인란 설정이있는 드롭 다운 목록 대화 상자에서 다음과 같이 구성하십시오.

  • 2.1)에서 적용하다 섹션에서 드롭 다운 목록의 항목에 대한 확인란을 만들 적용 범위를 지정합니다. 지정할 수 있습니다 특정 범위, 현재 워크 시트, 현재 통합 문서 or 열린 모든 통합 문서 필요에 따라.
  • 2.2)에서 모드 섹션에서 선택한 항목을 출력하려는 ​​스타일을 선택하십시오.
  • 여기에 걸립니다 수정 예를 들어 옵션을 선택하면 선택한 항목에 따라 셀 값이 변경됩니다.
  • 2.3)에서 분리 기호 상자에 여러 항목을 구분하는 데 사용할 구분 기호를 입력하십시오.
  • 2.4)에서 텍스트 방향 섹션에서 필요에 따라 텍스트 방향을 선택하십시오.
  • 2.5) 클릭 OK 버튼을 클릭합니다.

3. 마지막 단계에서 쿠툴 > 드롭 다운 목록 > 확인란이있는 드롭 다운 목록 > 확인란 드롭 다운 목록 활성화 이 기능을 활성화합니다.

이제부터는 지정된 범위의 드롭 다운 목록이있는 셀을 클릭하면 목록 상자가 팝업되며, 아래 데모와 같이 셀에 출력 할 체크 박스를 체크하여 항목을 선택하세요. (수정 모드를 예로 들어 ).

이 기능에 대한 자세한 내용은 여기를 방문하십시오.

  이 유틸리티의 무료 평가판 (30 일)을 받으려면 그것을 다운로드하려면 클릭하십시오을 클릭 한 다음 위 단계에 따라 작업 적용으로 이동합니다.


관련 기사 :

Excel 드롭 다운 목록에 입력 할 때 자동 완성
큰 값이있는 데이터 유효성 검사 드롭 다운 목록이있는 경우 적절한 항목을 찾기 위해 목록에서 아래로 스크롤하거나 전체 단어를 목록 상자에 직접 입력해야합니다. 드롭 다운 목록에 첫 글자를 입력 할 때 자동 완성을 허용하는 방법이 있다면 모든 것이 더 쉬워 질 것입니다. 이 튜토리얼은 문제를 해결하는 방법을 제공합니다.

Excel의 다른 통합 문서에서 드롭 다운 목록 만들기
통합 문서 내의 워크 시트간에 데이터 유효성 검사 드롭 다운 목록을 만드는 것은 매우 쉽습니다. 그러나 데이터 유효성 검사에 필요한 목록 데이터가 다른 통합 문서에있는 경우 어떻게 하시겠습니까? 이 자습서에서는 Excel의 다른 통합 문서에서 드롭 fown 목록을 만드는 방법에 대해 자세히 알아 봅니다.

Excel에서 검색 가능한 드롭 다운 목록 만들기
값이 많은 드롭 다운 목록의 경우 적절한 값을 찾는 것은 쉬운 일이 아닙니다. 이전에는 드롭 다운 상자에 첫 글자를 입력 할 때 드롭 다운 목록을 자동 완성하는 방법을 도입했습니다. 자동 완성 기능 외에도 드롭 다운 목록에서 적절한 값을 찾을 때 작업 효율성을 높이기 위해 드롭 다운 목록을 검색 가능하게 만들 수도 있습니다. 드롭 다운 목록을 검색 가능하게 만들려면이 자습서의 방법을 시도하십시오.

Excel 드롭 다운 목록에서 값을 선택할 때 다른 셀 자동 채우기
셀 범위 B8 : B14의 값을 기반으로 드롭 다운 목록을 만들었다 고 가정 해 보겠습니다. 드롭 다운 목록에서 값을 선택할 때 셀 범위 C8 : C14의 해당 값이 선택한 셀에 자동으로 채워지기를 원합니다. 문제를 해결하기 위해이 튜토리얼의 방법이 도움이 될 것입니다.

드롭 다운 목록에 대한 추가 자습서 ...

최고의 사무 생산성 도구

🤖 Kutools AI 보좌관: 다음을 기반으로 데이터 분석을 혁신합니다. 지능형 실행   |  코드 생성  |  사용자 정의 수식 만들기  |  데이터 분석 및 차트 생성  |  Kutools 기능 호출...
인기 기능: 중복 항목 찾기, 강조 표시 또는 식별   |  빈 행 삭제   |  데이터 손실 없이 열이나 셀 결합   |   수식없이 반올림 ...
슈퍼 조회: 다중 기준 VLookup    다중 값 VLookup  |   여러 시트에 걸친 VLookup   |   퍼지 조회 ....
고급 드롭다운 목록: 드롭다운 목록을 빠르게 생성   |  종속 드롭다운 목록   |  다중 선택 드롭 다운 목록 ....
열 관리자: 특정 개수의 열 추가  |  열 이동  |  Toggle 숨겨진 열의 가시성 상태  |  범위 및 열 비교 ...
특색 지어진 특징: 그리드 포커스   |  디자인보기   |   큰 수식 바    통합 문서 및 시트 관리자   |  리소스 라이브러리 (자동 텍스트)   |  날짜 선택기   |  워크 시트 결합   |  셀 암호화/해독    목록으로 이메일 보내기   |  슈퍼 필터   |   특수 필터 (굵게/기울임꼴/취소선 필터링...) ...
상위 15개 도구 세트12 본문 도구 (텍스트 추가, 문자 제거,...)   |   50+ 거래차트 유형 (Gantt 차트,...)   |   40+ 실용 방식 (생일을 기준으로 나이 계산,...)   |   19 삽입 도구 (QR 코드 삽입, 경로에서 그림 삽입,...)   |   12 매출 상승 도구 (숫자를 단어로, 환율,...)   |   7 병합 및 분할 도구 (고급 결합 행, 셀 분할,...)   |   ... 그리고 더

Excel용 Kutools로 Excel 기술을 강화하고 이전과는 전혀 다른 효율성을 경험해 보세요. Excel용 Kutools는 생산성을 높이고 시간을 절약하기 위해 300개 이상의 고급 기능을 제공합니다.  가장 필요한 기능을 얻으려면 여기를 클릭하십시오...

상품 설명


Office Tab은 Office에 탭 인터페이스를 제공하여 작업을 훨씬 쉽게 만듭니다.

  • Word, Excel, PowerPoint에서 탭 편집 및 읽기 사용, Publisher, Access, Visio 및 Project.
  • 새 창이 아닌 동일한 창의 새 탭에서 여러 문서를 열고 만듭니다.
  • 생산성을 50% 높이고 매일 수백 번의 마우스 클릭을 줄입니다!
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