combobox with columns

  • Thread starter Thread starter JT
  • Start date Start date
J

JT

I have a combo box on my form with 12 columns. The items
are added down in the first column when I use the
following code:

combobox1.add item var1
combobox1.add item var2
combobox1.add item var3
combobox1.add item var4

I would like to add them across in Col 1, Col 2, Col 3 and
Col 4.

I haven't used combo boxes before and am struggling with
this one.

Thanks for the help
 
If you build an array and then assign it to the combobox list property, it
should populate the columns, e.g.,

lbItem (1,1) = "Name" 'Row 1, Column 1
lbItem (1,2) = "Company" 'Row 1, Column 2
lbItem (2,1) = "Bill" 'Row 2, Column 1
lbItem (2,2) = "MS" 'Row 2, Column 2
combobox1.list = lbitem()

http://HelpExcel.com
 
if its a range

combobox1.List = worksheets("Sheet1") _
.Range("A2").Resize(20,12).Value
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top