PDA

View Full Version : Solved: Using 2nd value of listbox



Charlize
09-27-2006, 04:06 AM
With userform1.listbox1.value you can get the value of the first column in a listbox.
How can I use the 2nd or third value of a row in a listbox.

Something like userform1.listbox1.item(2).value. This refers to column no2 of the row that was selected in the listbox.

Needed for duplicate items in the first column. I can't use a vlookup for the rest of the info because of this.

Bob Phillips
09-27-2006, 06:34 AM
If you mean multiple selections




With Me.ListBox1
For i = 0 To .ListCount - 1
If .Selected(i) Then
Msgbox .List(i)
End If
Next i
End With

geekgirlau
09-28-2006, 12:44 AM
If you want the second column,



userform1.listbox1.Column(1)

Charlize
09-28-2006, 03:52 AM
If you want the second column,



userform1.listbox1.Column(1)



Thanks !!!

Charlize