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

How to calculate loan payments in Excel?
Use the PMT function: =PMT(5%/12,60,-25000) is for a $25,000 loan, 5% annual interest, 60 month loan.

Forum statistics

Threads
1,215,477
Messages
6,125,036
Members
449,205
Latest member
Eggy66

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