Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 96
Default combobox with columns

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


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 65
Default combobox with columns

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

"JT" wrote:

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



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default combobox with columns

if its a range

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

--
Regards,
Tom Ogilvy


"JT" wrote in message
...
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




Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
columns Widths for ComboBox jlclyde Excel Discussion (Misc queries) 2 October 14th 09 05:05 PM
fill combobox depending on selection from another combobox Adam Francis Excel Discussion (Misc queries) 2 July 24th 08 07:39 PM
OFFSET for multiple columns & combobox format sahafi Charts and Charting in Excel 2 April 30th 07 02:28 PM
How Do I Load A ComboBox RowSource From The Results Of Another ComboBox Minitman[_4_] Excel Programming 3 October 26th 04 07:58 PM
Populating combobox from another combobox David Goodall Excel Programming 1 September 12th 04 03:42 PM


All times are GMT +1. The time now is 02:27 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"