Populating a list from a list box

  • Thread starter Thread starter Payal Kadakia
  • Start date Start date
P

Payal Kadakia

I am conducting a survey and have created a bunch of
listboxes where users can select multiple items.

i.e. Please select all of the reporting tools you have
been trained in:
-then there is a pull down list box that contains a bunch
of applications they can choose from.

My question is this: If the user selects three different
applications, is there a way that the selected items can
be populated in another cell so that when I look at the
completed survey, i don't have to look for all of the
items they have highlighted? I can just look at this box
and see that they have selected application A, B, and C.

Thank You.
 
I am conducting a survey and have created a bunch of
listboxes where users can select multiple items.

i.e. Please select all of the reporting tools you have
been trained in:
-then there is a pull down list box that contains a bunch
of applications they can choose from.

My question is this: If the user selects three different
applications, is there a way that the selected items can
be populated in another cell so that when I look at the
completed survey, i don't have to look for all of the
items they have highlighted? I can just look at this box
and see that they have selected application A, B, and C.

Thank You.

Try this code

Function checklb()

a = 0
x = ListBox1.ListCount
For z = 0 To x - 1
If ListBox1.Selected(z) Then
If a = 0 Then
Cells(1, 2).Value = Cells(1, 2).Value & ListBox1.List(z)
a = 1
Else
Cells(1, 2).Value = Cells(1, 2).Value & "," & ListBox1.List(z)
End If
End If
Next

End Function

You will need to remember to set your listbox to multiselect as well

Your comma seperated list appears in Cell B1 in the active sheet.

HTH

Chris
 
Back
Top