permutations - Need to return unique user selections from multi select list box


Posted by Heidi on February 23, 2001 8:16 AM

Have a userform with a multi select list box with 3 bound columns from a row source that we want returned to a worksheet when the user selects multiple list box values. I can return the first value when it is a single list selection or I can return the values when using individual check boxes, with tons of conditional statements, but there are 300 unique row list box values so I'd appreciate any suggestions as to a cleaner solution.

Posted by Dave Hawley on February 23, 2001 9:14 AM


Heidi, try this on a blank sheet.


Private Sub CommandButton1_Click()
Dim i As Integer, ii As Integer

For i = 0 To ListBox1.ListCount - 1
If ListBox1.Selected(i) = True Then
For ii = 0 To 2
Cells(i + 1, ii + 1) = ListBox1.List(i, ii)
Next ii
End If
Next i

End Sub


Dave

OzGrid Business Applications



Posted by heidi on February 23, 2001 10:11 AM


Dave, thanks for the help! I'll give it a try.