Multicolumn Listbox - Transfer Item

michaeldh

Board Regular
Joined
Jun 11, 2002
Messages
201
Hi,

I have 2 identical 7 column userform list boxes and wish to transfer one row from list box 1 and add to list box 2.

Everything works except for the fact that it only transfers the item in the first colum.

Any ideas how I can get all 7 columns data for the specific row to transfer over?

ListBox2.AddItem ListBox1.Value

Thanks.
 

Excel Facts

Formula for Yesterday
Name Manager, New Name. Yesterday =TODAY()-1. OK. Then, use =YESTERDAY in any cell. Tomorrow could be =TODAY()+1.
Code:
With ListBox2
    .AddItem ListBox1.List(ListBox1.ListIndex, 0)
    .List(.ListCount - 1, 1) = ListBox1.List(ListBox1.ListIndex, 1)
    .List(.ListCount - 1, 2) = ListBox1.List(ListBox1.ListIndex, 2)
    .List(.ListCount - 1, 3) = ListBox1.List(ListBox1.ListIndex, 3)
    .List(.ListCount - 1, 4) = ListBox1.List(ListBox1.ListIndex, 4)
    .List(.ListCount - 1, 5) = ListBox1.List(ListBox1.ListIndex, 5)
    .List(.ListCount - 1, 6) = ListBox1.List(ListBox1.ListIndex, 6)
End With
 
Upvote 0

Forum statistics

Threads
1,224,590
Messages
6,179,754
Members
452,940
Latest member
rootytrip

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top