Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Combo Source from another file
I am trying to use data from a separate file to populate a ComboBox but am
having trouble. the code is crashing on the follwing statement; "wb1.Sheets("GUI").ComboBox1.ListFillRange = wb2.Sheets("Info").Range("A1:A4")". Could someone point me in the right direction please? Dim Sht As Worksheet Dim FolderName As String Dim wb1, wb2 As Workbook FolderName = "C:\info.xls" Set wb1 = ThisWorkbook Set wb2 = Workbooks.Open(FolderName) For Each Sht In wb2.Worksheets If Sht.Name = "Info" Then wb1.Sheets("GUI").ComboBox1.ListFillRange = wb2.Sheets("Info").Range("A1:A4") wb2.Close 'False Exit For End If Next Sht |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Combo Source from another file
Try...
"wb1.Sheets("GUI").ComboBox1.ListFillRange = wb2.Sheets("Info").Range("A1:A4")".Address(Externa l:=True) -- Jim Cone San Francisco, USA http://www.realezsites.com/bus/primitivesoftware "Steve" wrote in message I am trying to use data from a separate file to populate a ComboBox but am having trouble. the code is crashing on the follwing statement; "wb1.Sheets("GUI").ComboBox1.ListFillRange = wb2.Sheets("Info").Range("A1:A4")". Could someone point me in the right direction please? Dim Sht As Worksheet Dim FolderName As String Dim wb1, wb2 As Workbook FolderName = "C:\info.xls" Set wb1 = ThisWorkbook Set wb2 = Workbooks.Open(FolderName) For Each Sht In wb2.Worksheets If Sht.Name = "Info" Then wb1.Sheets("GUI").ComboBox1.ListFillRange = wb2.Sheets("Info").Range("A1:A4") wb2.Close 'False Exit For End If Next Sht |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Combo Source from another file
Outstanding!!! That did the trick. Thanks Jim
"Jim Cone" wrote: Try... "wb1.Sheets("GUI").ComboBox1.ListFillRange = wb2.Sheets("Info").Range("A1:A4")".Address(Externa l:=True) -- Jim Cone San Francisco, USA http://www.realezsites.com/bus/primitivesoftware "Steve" wrote in message I am trying to use data from a separate file to populate a ComboBox but am having trouble. the code is crashing on the follwing statement; "wb1.Sheets("GUI").ComboBox1.ListFillRange = wb2.Sheets("Info").Range("A1:A4")". Could someone point me in the right direction please? Dim Sht As Worksheet Dim FolderName As String Dim wb1, wb2 As Workbook FolderName = "C:\info.xls" Set wb1 = ThisWorkbook Set wb2 = Workbooks.Open(FolderName) For Each Sht In wb2.Worksheets If Sht.Name = "Info" Then wb1.Sheets("GUI").ComboBox1.ListFillRange = wb2.Sheets("Info").Range("A1:A4") wb2.Close 'False Exit For End If Next Sht |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How to find/edit combo box source? | New Users to Excel | |||
Variable row data source for combo boxes? | Excel Programming | |||
Source code for combo box in form | Excel Discussion (Misc queries) | |||
filling combo boxes from single outer source | Excel Discussion (Misc queries) | |||
Need One combo box row source to change based on the value of anot | Excel Programming |