R
Randy
Hi,
I've got two multi-select listboxes on a userform. The idea is that
listbox A contains all possible items and listbox B is a subset of A
defined by the user. I'm struggling with capturing the selected
values in A so that they can be copied to B. Here is my code:
With frmManageGroups.lbxA
For x = 0 To .ListCount - 1
If .Selected(x) = True Then
frmManageGroups.lbxB.AddItem .List(.ListIndex)
.Selected(x) = False
End If
Next
End With
The way that this is written, it only copies the last item selected in
listbox A. For example, if the listbox A contains the letters A,B,
and C as its items and the user selects A and C, my code copies the
letter C twice to listbox B instead of the letters A and C.
Can anybody help?
Thanks,
Randy
I've got two multi-select listboxes on a userform. The idea is that
listbox A contains all possible items and listbox B is a subset of A
defined by the user. I'm struggling with capturing the selected
values in A so that they can be copied to B. Here is my code:
With frmManageGroups.lbxA
For x = 0 To .ListCount - 1
If .Selected(x) = True Then
frmManageGroups.lbxB.AddItem .List(.ListIndex)
.Selected(x) = False
End If
Next
End With
The way that this is written, it only copies the last item selected in
listbox A. For example, if the listbox A contains the letters A,B,
and C as its items and the user selects A and C, my code copies the
letter C twice to listbox B instead of the letters A and C.
Can anybody help?
Thanks,
Randy