I have a list box that populates with different sets of data based on user selections.
How can I cycle through any given values that may be in the list box? Is this a For Each statement, or what?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You can do a
Forloop to examine each row in the listbox, and do whatever with the rows which are selected. In this example, I display the second column from selected items in the lstLocations listbox. (Column numbering starts with zero.)Note I assumed you want the selected items from the list box. If you want all items, selected or not, you could use
.ItemDataas @DavidRelihan suggested. However, in that case, you could get them from the listbox.RowSourceinstead.