Retrieve ListBox Items from a different workbook

Lebaron360

New Member
Joined
Mar 19, 2015
Messages
13
Hello all,

I am currently trying to find a way to reference data from a listbox in a userform (UserForm1) from a different worksheet. The flow of the process I am trying to accomplish should look something like this:

Book1 has a UserForm with two ListBoxes. ListBox1 is populated with data from Book1. ListBox2 is populated with items selected by the user that are moved from ListBox1.

After selecting the items for ListBox2, a new workbook is created: Book2.

In Book2, I want to loop through the items that were selected for ListBox2 and populate Book2 with data from Book1 (via VLOOKUP or some other procedure, maybe?)

I am currently trying to reference the data for ListBox2 with the following code but getting an error:


Dim ListItem As Integer
Dim CurrentManager As String

For ListItem = 1 To Workbooks("Book1.XLSM").UserForm1.ListBox2.ListCount
CurrentManager = Workbooks("Book1.XLSM").UserForm1.ListBox2.List(ListItem - 1)
Next ListItem


Thanks in advance for your help!!
 

Excel Facts

Create a chart in one keystroke
Select the data and press Alt+F1 to insert a default chart. You can change the default chart to any chart type

Forum statistics

Threads
1,216,177
Messages
6,129,323
Members
449,501
Latest member
Amriddin

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