HOW to find the value of data in a list box?

G

Guest

Hello,

I have a list box that is loaded with text values.
To retreive the data I use the itemIndex property.

How do I find out what the text is? In VBA, what property or method do I use?

for example
IF lstTest._____ = "CAT" then
IF lstTest._____ = "DOG" then
 
G

Guest

If Me.lstText.Itemdata(n) =
Where n is an integer from 0 to .ListCount - 1

For example:

For lngNdx = 0 to Me.lstText.ListCount - 1
If Me.lstText.Itemdata(lngNdx) = "Wiener Dog" Then
Msg Box "Found it"
Exit For
End If
Next lngNdx
 

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

Top