I can't seem to figure this one out.

What I am trying to do is cycle through a large list of items in a ListBox and be able to get the text of whatever item is currently selected.

I have a listbox with multiselect enabled. I want it to go through a list of names and grab only the ones that are selected and add them to a second listbox.

Here is what I'm doing.

VB Code:
  1. Dim i As Integer
  2.    Do until i = lstnames.ListIndex -1
  3.        If lstnames.Selected(i) = True then
  4.               lstdept.AddItem   'this is where I get stuck
  5.        End If
  6.        i = i + 1
  7.    Loop

I've tried using lstnames.Text, but that only keeps grabbing the first item selected.

I appreciate the help

Thanks