Userform Multi-Column Combobox

LPoz28

New Member
Joined
Jun 23, 2018
Messages
1
I have a userform which has some comboboxes. On initialize, the comboboxes' drop down lists are populated with a literal 2d array. Later in the initialize code I pull information from various sheets into the userform (info from previous contacts). The reason for the 2d array is that a few fields have code numbers so I figured when the combobox is loaded with information I'm pulling from the records, say 01, 02, it would display the text (2nd column of combo), i.e. 01 = Wages, 02 = unemployment. However, it will display the actual value of what is being pulled in. Is it possible to have the combo show the text when the data matches the bound column or does filling it via vba override that and just puts in the value of the field I'm pulling from.

When I use this: Me.Controls("CoBoxIncType" & ii) = Trim(.Cells(i, "Q").Value) I get the exact value of what is in cell "Q" row (i)

I tried this: Me.Controls("CoBoxIncType" & ii).column(0) = Trim(.Cells(i, "Q").Value). it doesn't work


Should I just use a 1d array and instead call a function (case select) that will return the string I want to put into the combobox?

Thanks,

Poz
 

Excel Facts

Move date out one month or year
Use =EDATE(A2,1) for one month later. Use EDATE(A2,12) for one year later.

Forum statistics

Threads
1,223,903
Messages
6,175,289
Members
452,631
Latest member
a_potato

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