Simple ListBox Question

G

Guest

I would like to set up a for-loop like the one below relating to a list box. Could anyone please help me with the proper syntax? Is it possible to cycle through a list box and do things related to each item in the listbox?

FOR EACH 'item' in LISTBOX
Do stuff
Next

Thanks in advance!!!
 
C

Cor Ligthert

Hi Matt,

Can you try if this works for you?

FOR EACH Item as datarowview in LISTBOX
Do stuff
Next

I hope this helps?

Cor
 
H

Herfried K. Wagner [MVP]

* "=?Utf-8?B?TWF0dA==?= said:
I would like to set up a for-loop like the one below relating to a list box. Could anyone please help me with the proper syntax? Is it possible to cycle through a list box and do things related to each item in the listbox?

FOR EACH 'item' in LISTBOX
Do stuff
Next

\\\
Dim o As Object
For Each o In Me.ListBox1.Items
...
Next o
///
 
G

Guest

try this:

For Each item as string In listbox.Items
'do something
Next


HTH,

gani
http://thedeveloperscorner.com.ph

-----Original Message-----
I would like to set up a for-loop like the one below
relating to a list box. Could anyone please help me with
the proper syntax? Is it possible to cycle through a
list box and do things related to each item in the
listbox?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top