View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Chip Pearson[_2_] Chip Pearson[_2_] is offline
external usenet poster
 
Posts: 95
Default Putting Listbox data in cells

Todd,

Try something like the following:

Dim Rng As Range
Dim Ndx As Long
Set Rng = Range("Z1")
With Me.ListBox1
For Ndx = 0 To .ListCount - 1
If .Selected(Ndx) = True Then
Rng.Value = .List(Ndx)
Set Rng = Rng(2, 1)
End If
Next Ndx
End With


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com


"Todd Huttenstine" wrote in message
...
I have a listbox that populates values from a specified
range on a worksheet. I have the MultiSelect property set
to fmMultiSelectMulti. This causes a check mark to be
placed to the left of each value in the dropdown box of
the Listbox. There can be a possible 26 values in the
listbox.

I also have a range Z1:Z26.

I would like for when the user puts a check in the check
box, the code put that value that is checked in the
corresponding cell in the range. For example, lets say
the user puts a check next "Todd" and a check next
to "Dan". I would like for Z1 to say "Todd" and for Z2 to
say "Dan".

How would I do this?

Todd