Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 39
Default Looping through a listbox

Simple question...How do I loop through a multi-select single listbox
with 2 columns?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,441
Default Looping through a listbox

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


"EAB1977" wrote in message
...
Simple question...How do I loop through a multi-select single listbox
with 2 columns?



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Looping Listbox in Userform ZipCurs Excel Programming 10 March 20th 08 04:58 PM
Listbox Looping Bret Excel Programming 1 October 24th 06 02:38 AM
Looping to fill ListBox davidm Excel Programming 2 January 5th 06 08:39 AM
Looping through listbox controls Vince Excel Programming 11 April 12th 05 04:40 PM
Excel VBA-Looping though MultiSelect on ListBox jpendegraft[_3_] Excel Programming 2 February 3rd 04 04:38 PM


All times are GMT +1. The time now is 09:48 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"