Populate listbox on userform from another workbook

ipbr21054

Well-known Member
Joined
Nov 16, 2010
Messages
5,596
Office Version
  1. 2007
Platform
  1. Windows
I have a userform which has a Listbox.
I would like to populate this Listbox with customers names another workbook.
The selected Listbox name would then be placed in Textbox1

Some info for you for the external workbox etc

Workbook is called DR
Worksheet in question is called POSTAGE
Customers names are in column B
The population wouldnt need to list ALL from column B but say last row & up 10 rows
 

Excel Facts

Format cells as currency
Select range and press Ctrl+Shift+4 to format cells as currency. (Shift 4 is the $ sign).
@Engberg
Ive been using this for a good while now & like to ask you a question please.
The code at present populates a userform Combobox & the values are taken from worksheet DATABASE & sheet POSTAGE.
On the POSTAGE sheet is it possible for the code to only populate the Combobox with customers names that havent had a hyperlink applied to them ?

Basically some of the customers names will have been hyperlinked & some not, so at present the code takes the last 10 customers names & puts them in combobox list.
Later on the combobox selection will have a hyperlink applied to them.
So is it possible for the code to only get the names without hyperlinks.
Thanks



VBA Code:
    With GetObject("C:\Users\Ian\Desktop\REMOTES ETC\DR\DR.xlsm") 'THIS POPULATES THE DROPDOWN FOR THE CUSTOMERS NAMES
        Set s = .Sheets("POSTAGE")
        Set b2 = s.Cells(s.Range("B" & s.UsedRange.Rows.Count + 1).End(xlUp).Row, "B")
        Set b1 = b2.Offset(-10, 0) 'THE MINUS VALUE IS HOW MANY NAMES TO BE SHOWN IN DROP DOWN LIST
        ComboBox1.List = s.Range(b1, b2).Value
       .Close 0
End With
 
Upvote 0

Forum statistics

Threads
1,220,965
Messages
6,157,119
Members
451,398
Latest member
rjsteward

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