-
Hi,
I was wondering if there was a way to select an item in a dropdown list via it's .ItemData value as opposed to the .List value..
I know that you can use the following code to select the item via the .List value:
Code:
Combo1 = Combo1.List(1)
How would I select the item via the .ItemData value?
Any help would be appreciated..
Dan
-
Unfotunately there's no direct way of doing it, but you can loop through a listbox and if the ItemData is the one you need then selec it:
Code:
Dim i As Integer
For i = 0 To List1.ListCount - 1
'Or any value you're looking for
If List1.ItemData(i) = 5 Then
List1.ListIndex = i
Exit For
End If
Nex