Displaying Multiple Values Selected in a List Box

smlaff304

New Member
Joined
Aug 13, 2007
Messages
21
Hi, I have been reading the forum for quite a while now, always finding answers to my problems; thus this is my first post.

I am working on a user form for a college co-op project that I am working on. I have a list of data, which I have used as the input to a list box. I want to use the multiple selection option within the list box and be able to display the items selected.

So far I can only display single values. Does anyone have any suggestions on how I can go about having multiple selections appear in an adjacent column?

Any help would be very greatly appreciated. :cry:
 

Excel Facts

Fastest way to copy a worksheet?
Hold down the Ctrl key while dragging tab for Sheet1 to the right. Excel will make a copy of the worksheet.
try somethign like this
Code:
Private Sub ListBox1_Click()
Dim i As Long, msg As String
With ListBox1
     If .ListIndex <> -1 Then
          For i = 1 To .ListCount
               If .Selected(i) Then msg = msg & .List(i - 1) & vbLf
          Next
          MsgBox msg
     End If
End With
End Sub
 
Upvote 0
I'm very new to this, I should just copy/paste this code into the code generator for the List Box? Paste this under where it says:

Sub ListBox1_Change()

Thanks again for the help.
 
Upvote 0
1) right click on the sheet tab - [ViewCode]
2) Delete whatever on the right pane
3) Copy my code and paste there
 
Upvote 0

Forum statistics

Threads
1,214,832
Messages
6,121,844
Members
449,051
Latest member
excelquestion515

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top