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

A

Angelb1

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
 
K

Klatuu

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
 
Top