bs0d
Well-known Member
- Joined
- Dec 29, 2006
- Messages
- 622
Super simple question - Is it possible to get the value of a selected listbox item once it's clicked? I'm not having any luck. I'm trying:
This... doesn't do anything. How can I get the value of the items selected? If multiple, does it come in an array? Am I forced to loop through the list to find all selected items?
I'd like to run some code that takes the value of the item selected, and different code once the item is un-selected - instead of looping through the list. Thoughts?
Code:
Sub lstMyListbox_Click()
z = msgbox("you selected: " & activesheet.lstMyListbox.value & " from the list.", vbOkOnly, "Info")
End Sub
This... doesn't do anything. How can I get the value of the items selected? If multiple, does it come in an array? Am I forced to loop through the list to find all selected items?
I'd like to run some code that takes the value of the item selected, and different code once the item is un-selected - instead of looping through the list. Thoughts?