al.extreme
New Member
- Joined
- Nov 29, 2010
- Messages
- 15
Hi
I have listbox1 MultiSelectExtended (2 columns). If the items are selected I add them to listbox2 (also in 2 columns) with a CommandButton. The problem is that the code I have in the CommandButton adds them upside down!
I want to transfer from listbox1 to listbox 2 in the same order as listbox1 (Top to Bottom)
Can someone help me ?
Thanks
This is the code:
With ListBox1
For eCount = .ListCount - 1 To 0 Step -1
If .Selected(eCount) = True Then ' if selected then
ListBox2.AddItem .List(eCount, 0) 'add to listbox2, Column 0
ListBox2.Column(1, ListBox2.ListCount - 1) = .List(eCount, 1) 'add to listbox2, Column 1
End If
Next
End With
I have listbox1 MultiSelectExtended (2 columns). If the items are selected I add them to listbox2 (also in 2 columns) with a CommandButton. The problem is that the code I have in the CommandButton adds them upside down!
I want to transfer from listbox1 to listbox 2 in the same order as listbox1 (Top to Bottom)
Can someone help me ?
Thanks
This is the code:
With ListBox1
For eCount = .ListCount - 1 To 0 Step -1
If .Selected(eCount) = True Then ' if selected then
ListBox2.AddItem .List(eCount, 0) 'add to listbox2, Column 0
ListBox2.Column(1, ListBox2.ListCount - 1) = .List(eCount, 1) 'add to listbox2, Column 1
End If
Next
End With