Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 66
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,593
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 66
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,489
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
columns Widths for ComboBox jlclyde Excel Discussion (Misc queries) 2 October 14th 09 05:05 PM
Multi-column combobox - allow text to span columns? [email protected] Excel Programming 1 September 1st 07 12:37 AM
OFFSET for multiple columns & combobox format sahafi Charts and Charting in Excel 2 April 30th 07 02:28 PM
Select entire columns in worksheet and place into combobox 3axles Excel Programming 1 May 9th 05 10:56 AM
combobox with columns JT[_2_] Excel Programming 2 February 15th 05 11:01 PM


All times are GMT +1. The time now is 02:31 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"