Hi guys,
i know this has been done to death. but i still cannot digest it. I have done hundreds of search in the last month, youtube, etc but maybe coz i am not bright enough, and i am a noob at VBA, i cannot make it working.
Here is what i am trying to do: I want to populate comboboxes in main.xlsm from a range in another workbooks (name.xlsx and city.xlsx).
main.xlsm has 2 comboboxes. combobox 1 will contain value/range from workbooks name.xlsx (b2:b6), and combobox 2 will contain value from workbook city.xlsx (a2:a5).
I have tried some code, including the one i seen in this forum.
e.g.
ThisWorkBook
Code
Private Sub Workbook_Open()
Dim oWbSource As Workbook
Dim rSource As Range
With Sheet1.ComboBox1
.Clear
Set rSource = Application.Workbooks("name.xlsx").Worksheets("Sheet1").Range("b2:b6")
.ComboBox1.RowSource = rSource.Address(external:=True)
.ListIndex = -1
End With
End Sub
Display More
but none is working.
is anyone here kind enough to show me how to accomplish this? many thanks!