Populating a multicolumn Listbox from 2 other Listboxes

stirlingmw

Board Regular
Joined
Feb 18, 2013
Messages
75
I have a Userform which I can pass data from one ListBox to another. This works well with one list of data that is to be transferred over. However, i need to add another column of data.
I have 2 Listboxes "Role" and "Name" which now should make up a list item to be passed into a third listbox "Owner". Both items should then be removed from their original listboxes so that they cannot be selected again.
the code i am currently using to transfer data in one column is as follows:

Code:
Private Sub BTN_MoveSelectedRight_Click()


    Dim iCtr As Long


    For iCtr = 0 To Me.ListName.ListCount - 1
           
        If Me.ListName.Selected(iCtr) = True Then
           Me.ListBox2.AddItem Me.ListName.List(iCtr)
        End If
    Next iCtr


    For iCtr = Me.ListName.ListCount - 1 To 0 Step -1
        If Me.ListName.Selected(iCtr) = True Then
            Me.ListName.RemoveItem iCtr
        End If
    Next iCtr
End Sub

Can this be modified so that Listbox2 will contain an additional Column to include "ListRole"?

Thanks

Steve
 

Excel Facts

What do {} around a formula in the formula bar mean?
{Formula} means the formula was entered using Ctrl+Shift+Enter signifying an old-style array formula.

Forum statistics

Threads
1,214,947
Messages
6,122,411
Members
449,081
Latest member
JAMES KECULAH

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