Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
multi select listbox
Hi All,
In the line of code below I am trying to insert the checked items from the multiselect-extended listbox into a1 and add next checked items to the right. Its only copying the last item selected and placing it in "IV1". I cannot seem to get this to work. For i = 0 To Me.ListBox1.ListCount - 1 If Me.ListBox1.Selected(i) Then range("A1").Select ActiveCell.Offset(0, 1).Value = Me.ListBox1.list(i) End If Next i *** Sent via Devdex http://www.devdex.com *** Don't just participate in USENET...get rewarded for it! |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
multi select listbox
I don't see anything that would write to IV1, but you are writing everything
to B1, so you would see only the last item in B1: j = 0 For i = 0 To Me.ListBox1.ListCount - 1 If Me.ListBox1.Selected(i) Then range("A1").Offset(0, j).Value = Me.ListBox1.list(i) j = j + 1 End If Next i "Paul Mueller" wrote in message ... Hi All, In the line of code below I am trying to insert the checked items from the multiselect-extended listbox into a1 and add next checked items to the right. Its only copying the last item selected and placing it in "IV1". I cannot seem to get this to work. For i = 0 To Me.ListBox1.ListCount - 1 If Me.ListBox1.Selected(i) Then range("A1").Select ActiveCell.Offset(0, 1).Value = Me.ListBox1.list(i) End If Next i *** Sent via Devdex http://www.devdex.com *** Don't just participate in USENET...get rewarded for it! |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
multi select listbox
Paul,
Try this For i = 0 To Me.ListBox1.ListCount - 1 If Me.ListBox1.Selected(i) Then j=j+1 Cells(1,j).Value = Me.ListBox1.list(i) End If Next i -- HTH Bob Phillips ... looking out across Poole Harbour to the Purbecks (remove nothere from the email address if mailing direct) "Paul Mueller" wrote in message ... Hi All, In the line of code below I am trying to insert the checked items from the multiselect-extended listbox into a1 and add next checked items to the right. Its only copying the last item selected and placing it in "IV1". I cannot seem to get this to work. For i = 0 To Me.ListBox1.ListCount - 1 If Me.ListBox1.Selected(i) Then range("A1").Select ActiveCell.Offset(0, 1).Value = Me.ListBox1.list(i) End If Next i *** Sent via Devdex http://www.devdex.com *** Don't just participate in USENET...get rewarded for it! |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Multi-field listbox in an Excel form | Excel Discussion (Misc queries) | |||
populating a multi-column Listbox | Excel Programming | |||
populating a multi-column Listbox | Excel Programming | |||
Multi-columns in a ListBox | Excel Programming | |||
Extract values from a multi-select multi-column list-box | Excel Programming |