filling combo box

  • Thread starter Thread starter Mike
  • Start date Start date
Mike,

Open the file
Either copy the data to the combobox file and point the combobox at that
data, or add them to the combobox
Close the file

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)
 
Thanks for the code. I would prefer to use the first code example. But I
am having trouble programming with columncount property. I have 3 columns
to be displayed in the combobox.
I do I do that? BoundColumn will be set to 1.

Lastly, how do I sort the values within the combo box?
 
This pseudo code should show you how to do it.

Dim rng as Range
Workbooks.Open Filename:="c:\myTest\Testfile_1.xls"
With Activesheet.
.sort Key1:=.Range("A1'), _
Order1:=xlAscending, Header:=xlNo
set rng = .Range("A1").CurrentRegion
End With
With Userform1.Combobox1
.Columncount = 3
.List = rng.Value
.BoundColumn = 1
End With
Activeworkbook.Close SaveChanges:=False
 
Back
Top