Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
combobox multiple columns
I use the following code to populate a combobox (on a userform) with a list
of names and associated numbers (colour codes) Dim BuMs() ReDim BuMs(y, 1) BuMs(1,0)="Fred" BuMs(1,1)=1 cmbBuMs.List = BuMs The combobox displays the names, but when I process the form, I also want to use the colur code, how do I access it? |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
combobox multiple columns
I think you will be unlucky with that one.
-- HTH Bob (there's no email, no snail mail, but somewhere should be gmail in my addy) "Graham Y" wrote in message ... I use the following code to populate a combobox (on a userform) with a list of names and associated numbers (colour codes) Dim BuMs() ReDim BuMs(y, 1) BuMs(1,0)="Fred" BuMs(1,1)=1 cmbBuMs.List = BuMs The combobox displays the names, but when I process the form, I also want to use the colur code, how do I access it? |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
combobox multiple columns
Thanks Bob
Was hoping I might have missed something. I'll just have to use the index to look the value up from the array. "Bob Phillips" wrote: I think you will be unlucky with that one. -- HTH Bob (there's no email, no snail mail, but somewhere should be gmail in my addy) "Graham Y" wrote in message ... I use the following code to populate a combobox (on a userform) with a list of names and associated numbers (colour codes) Dim BuMs() ReDim BuMs(y, 1) BuMs(1,0)="Fred" BuMs(1,1)=1 cmbBuMs.List = BuMs The combobox displays the names, but when I process the form, I also want to use the colur code, how do I access it? |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
combobox multiple columns
Hi,
Can you not make use of the boundcolumn? Private Sub UserForm_Initialize() Dim BuMs(), y y = 3 ReDim BuMs(y, 1) BuMs(1, 0) = "Fred" BuMs(1, 1) = 1 BuMs(2, 0) = "John" BuMs(2, 1) = 3 BuMs(3, 0) = "Mike" BuMs(3, 1) = 5 cmbBuMs.List = BuMs cmbBuMs.BoundColumn = 2 End Sub Private Sub cmbBuMs_Change() MsgBox cmbBuMs.Text & vbLf & cmbBuMs.Value End Sub Cheers Andy -- Andy Pope, Microsoft MVP - Excel http://www.andypope.info "Graham Y" wrote in message ... Thanks Bob Was hoping I might have missed something. I'll just have to use the index to look the value up from the array. "Bob Phillips" wrote: I think you will be unlucky with that one. -- HTH Bob (there's no email, no snail mail, but somewhere should be gmail in my addy) "Graham Y" wrote in message ... I use the following code to populate a combobox (on a userform) with a list of names and associated numbers (colour codes) Dim BuMs() ReDim BuMs(y, 1) BuMs(1,0)="Fred" BuMs(1,1)=1 cmbBuMs.List = BuMs The combobox displays the names, but when I process the form, I also want to use the colur code, how do I access it? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
columns Widths for ComboBox | Excel Discussion (Misc queries) | |||
Multi-column combobox - allow text to span columns? | Excel Programming | |||
OFFSET for multiple columns & combobox format | Charts and Charting in Excel | |||
Select entire columns in worksheet and place into combobox | Excel Programming | |||
combobox with columns | Excel Programming |