Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Excel 2000 - Combo Box - AddItem

Status
Not open for further replies.

KenReay

Programmer
Aug 15, 2002
5,424
GB
Hi

Is it possible to have a multi column combo box, eg Code, Description in the way you can in Access ?

If yes, how do you use the .AddItem method to populate the combo with values ?

Thanks



Regards

Ken Reay
Freelance Solutions Developer
Boldon Information Systems Ltd
Website needs upgrading, but for now - UK
 
Ken - yes you can - I think it is pretty similar to Access.

All you need to do is set the ColumnCount property of the combobox to however many columns you need. You then assign an array of values to be the controlsource or rowsource...The following is from XP VBA help:

MSExcel Helpfiles said:
Add items to a list using the List or Column property

Create a multicolumn ListBox or ComboBox.

create a two-dimensional array that contains the items you want to put in the list.

Set the ColumnCount property of the ListBox or ComboBox to match the number of entries in the list.



Do one of the following:

Assign the array as the value of the List property. The contents of the ListBox will match the contents of the array exactly.

Assign the array as the value of the Column property. Column transposes rows and columns, so each row of the ListBox matches the corresponding column of the array.

Rgds, Geoff

Three things are certain. Death, taxes and lost data. DPlank is to blame

Please read FAQ222-2244 before you ask a question
 
Hi

Thanks Geoff, always embarassing when the answer is in help, my only defence is that particualr part does not appear to be in Excel2000 help !

Regards

Ken

Regards

Ken Reay
Freelance Solutions Developer
Boldon Information Systems Ltd
Website needs upgrading, but for now - UK
 
no probs Ken - it wasn't the most intuitive to find. To be honest, I only really quoted the helpfile as it is not something I have done personally and I wanted to make sure you got the correct info ;-)

Rgds, Geoff

Three things are certain. Death, taxes and lost data. DPlank is to blame

Please read FAQ222-2244 before you ask a question
 
Here is one that sorts...
I can't understand it may be you can..



________________________________________________________________________
Zameer Abdulla
Visit Me
Children are poor men's riches.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top