List Box Selected Item VBA (1 Viewer)

ryand09

New member
Local time
Today, 15:37
Joined
Nov 4, 2015
Messages
6
Hello


I’m looping through a list box returning the selected item, but is there a way to return the value of other columns in the list as I loop through the rows?

For Each ItemIndex In Me.myList.ItemsSelected

lngID = Me.myList.ItemData(ItemIndex) ‘Working okay
lngEmp = Me.myList.ItemData(ItemIndex,1) ‘Not working

Next

Thanks in advance.
 

Cronk

Registered User.
Local time
Tomorrow, 02:37
Joined
Jul 4, 2013
Messages
2,770
Use the column property

Code:
For Each ItemIndex In Me.myList.ItemsSelected 

lngID = Me.myList.ItemData(ItemIndex) ‘Working okay
lngEmp = Me.myList.Column(1, ItemIndex) 

Next
 

Users who are viewing this thread

Top Bottom