ListIndex Property

  • Thread starter Thread starter ajbarilla
  • Start date Start date
A

ajbarilla

Is there a way in VBA code to find the value in a listbox if I know the
ListIndex number that I want to chose? For instance, if I want to
find the third value in a list box, I want to be able to find it by
using the ListIndex value of 2. Any help would be appreciated.
 
Debug.Print Me.ListboxName.ItemData(IndexNumber)

Don't forget that the first entry begins at 0.

Debug.Print Me.List.ItemData(2)

will return the value of the 3 entry in the listbox

Daniel
 

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

Back
Top