I'm trying to create a standard listbox, with the option to move items from one to another.
As you can imagine, I have a button with the following code:
It checks which items are selected, adds them to the list box (using the subroutine AddEntry), but the problem comes when you remove the item - the list is now shorter, so of course it's looking for an entry that doesn't exist.
Any ideas how I can deal with this?
As you can imagine, I have a button with the following code:
VBA Code:
With lstLocations
For lngListCount = 0 To .ListCount - 1
If .Selected(lngListCount) = True Then
Call AddEntry("lstList1", .List(lngListCount))
.RemoveItem (lngListCount)
End If
Next
End With
It checks which items are selected, adds them to the list box (using the subroutine AddEntry), but the problem comes when you remove the item - the list is now shorter, so of course it's looking for an entry that doesn't exist.
Any ideas how I can deal with this?