Looping through a listbox

E

EAB1977

Simple question...How do I loop through a multi-select single listbox
with 2 columns?
 
B

Bernie Deitrick

On a userform?

Private Sub CommandButton1_Click()
Dim i As Integer
For i = 0 To Me.ListBox1.ListCount - 1
If Me.ListBox1.Selected(i) Then
MsgBox ListBox1.List(i, 0) & " " & ListBox1.List(i, 1)
End If
Next i
End Sub

HTH,
Bernie
MS Excel MVP
 
Top