list boxes

J

joe powers

Hi,
I have a list box that allows a user to make multiple
selections. I would like to take the selected rows and
store them in another column on my worksheet so that I can
do vlookups. Does anyone have any ideas on how to
accomplish this?
TIA
 
S

Stan Scott

Joe,

This macro creates a list of the selected items for ListBox1, beginning in
cell G1:

Sub CreateList()
Dim c
Dim t

c = 0
With Sheet1
For t = 0 To .ListBox1.ListCount - 1
If .ListBox1.Selected(t) Then
.Range("G1").Offset(c) = .ListBox1.List(t)
c = c + 1
End If
Next
End With
End Sub

Stan Scott
New York City
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top