VBA Combo Box Display of selected item

Giordano Bruno

Well-known Member
Joined
Jan 7, 2007
Messages
1,356
I have a Combo Box which lists three columns. It's actually 8 columns, but the middle five are set to width zero in the combo box. When I select an item, the display window shows only the value in the left hand column. This column is sometimes blank and so if I select one of these rows, the selection window shows nothing at all.

Is it possible to display more than just the first column or am I wasting my time trying?
 

Excel Facts

Which Excel functions can ignore hidden rows?
The SUBTOTAL and AGGREGATE functions ignore hidden rows. AGGREGATE can also exclude error cells and more.
You can display as many columns as you want.

Which columns do you want to display and how?
 
Upvote 0
Hi Norrie,

Thanks for your reply. My RowSource is C12:J449 and ColumnWidths are
49.95 pt;49.95 pt;0 pt;0 pt;0 pt;0 pt;0 pt;100 pt. Thus the drop down shows only columns C, D and J. When a selection is made, I would like the display window to show the selected values of these same three columns. Currently only column C is displaying in the selection window and sometimes this is blank.
 
Upvote 0
You cannot have multiple columns as the return value, so I suggest you pick a column that does have values for each row if possible.
 
Upvote 0
Thanks rorya,

Can you tell me how to choose a different column for the return value? I don't want to change the order of the columns.
 
Upvote 0
Change the boundcolumn (or textcolumn, if you only want to alter what is displayed in the textbox part, not the actual return value) to whichever column you wish.
 
Upvote 0
Giordano

What do you mean by the selection window?

PS Why an 8-column combobox when you are only displaying 3 columns?
 
Upvote 0
Hi Norrie,

I want to show only columns C, D and J. There are calculations and other rubbish in E to G.

The only way I know to show just C, D and J is to make the RowSource C to J and make the ColumnWidths zero for the columns I don't want displayed.

Once the user makes a selection, his choice is displayed in what I called the "Selection Window", i.e. the window with the drop down arrow next to it.

Does that make sense?
 
Upvote 0
Sort of, apart from the population of the combobox.

It's pretty straightforward to populate a combobox from non-contiguous columns eg columns C, I and J.

You wouldn't use RowSource, which isn't usually a good idea anyway, but it can be done.
 
Upvote 0

Forum statistics

Threads
1,224,599
Messages
6,179,828
Members
452,946
Latest member
JoseDavid

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top