hpp123
asked on
Get First Selected Item In A Listbox
I have a list box. The user can select multiple lines in the list box. How do I get the row and column of the first line they select in the list box? Say they select row 3, 7, 9, 11. I need the .column(row, column) for line 3.
Any help will be greatly appreciated!
Any help will be greatly appreciated!
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
That did the trick! Thank you!!!
no probs
note sVal is set to nothing if no selections made
note sVal is set to nothing if no selections made
dim bLoop as Boolean
dim i as integer
dim sVal as string
bLoop = True
i=0
sval = ""
do while bLoop = True
if i > lstbox.ListCount-1 then
bLoop = False
elseif lstbox.selected(i) = True
bloop = false
sVal = lstbox.selected(i)
end if
i=i+1
loop
if sVal <> "" then msgbox "First item = " & sVal