Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 363
Default Refering to 2nd Column in a Combobox

When using a Combobox with more than 1 CoumnCounts :

If i use the "ComboBox2.Value" line i get the Value in Column 1
How do i refer to the 2nd Column ?

Combobox2(Column(2).Value ??


Corey....


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 812
Default Refering to 2nd Column in a Combobox

MsgBox ComboBox2.List(2, 1)
will give the 3rd row, 2nd column (since the base is 0) of ComboBox2.
ComboBox2.Value would give you the value in the BoundColumn of the
selected row.

Hth,
Merjet

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 363
Default Refering to 2nd Column in a Combobox

So how do i get the Value in the 2nd column not the boundcolumn?
The MsgBox ComboBox2.List(2, 1) sems to give me a irrellevant value??
"merjet" wrote in message
oups.com...
MsgBox ComboBox2.List(2, 1)
will give the 3rd row, 2nd column (since the base is 0) of ComboBox2.
ComboBox2.Value would give you the value in the BoundColumn of the
selected row.

Hth,
Merjet


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 812
Default Refering to 2nd Column in a Combobox

Corey,

I checked what I wrote in #2 and it was accurate.

I can't see what you do to get your results. If you want to send an
Excel file to my e-mail address, maybe with some guidance on how to
replicate what you are doing, I will take a look.

Merjet


  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 363
Default Refering to 2nd Column in a Combobox

So if i have 2 columns in Combobox2 and the Values Chosen(Displayed) was:

ALPHABET SOUP


On a msg & Combobox2.value would display ALPHABET


If i wanted to display BOTH values i would do what:

Msg & Combobox2.value & Combobox2.(List2,1)

To show :

ALPHABET SOUP in the MSG???




"merjet" wrote in message
oups.com...
Corey,

I checked what I wrote in #2 and it was accurate.

I can't see what you do to get your results. If you want to send an
Excel file to my e-mail address, maybe with some guidance on how to
replicate what you are doing, I will take a look.

Merjet





  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 812
Default Refering to 2nd Column in a Combobox

Either of these should work:
1. MsgBox ComboBox2.Value & " " & ComboBox2.List(ListIndex, 1)
if BoundColumn = 1 and ALPHABET in selected row
2. MsgBox ComboBox2.List(2,0) & " " & ComboBox2.List(2, 1)
if ALPHABET in the 3rd row (2nd since counting starts with 0)

Merjet


  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 363
Default Refering to 2nd Column in a Combobox

I have the BoundColumn =2
ColumnCount=2
And ALPHABET is on the LEFT SIde of the Combobox.

I still seem to get illogical numerical values in the other value in the msg.

Whe
ALPHABET SOUP


I get

ALPHABET 13


??


Using :


MsgBox & ComboBox2.Value & " " & ComboBox2.List(2, 0)


"merjet" wrote in message
oups.com...
Either of these should work:
1. MsgBox ComboBox2.Value & " " & ComboBox2.List(ListIndex, 1)
if BoundColumn = 1 and ALPHABET in selected row
2. MsgBox ComboBox2.List(2,0) & " " & ComboBox2.List(2, 1)
if ALPHABET in the 3rd row (2nd since counting starts with 0)

Merjet



  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Refering to 2nd Column in a Combobox


sVal1 = "": sVal2=""
With Combobox2
if .ListIndex < -1 then
sVal2 = .List(.ListIndex,1)
sVal1 = .List(.Listindex,0)
end if
End With

msgbox sVal1 & " " & sVal2

--
Regards,
Tom Ogilvy


"Corey" wrote in message
...
I have the BoundColumn =2
ColumnCount=2
And ALPHABET is on the LEFT SIde of the Combobox.

I still seem to get illogical numerical values in the other value in the
msg.

Whe
ALPHABET SOUP


I get

ALPHABET 13


??


Using :


MsgBox & ComboBox2.Value & " " & ComboBox2.List(2, 0)


"merjet" wrote in message
oups.com...
Either of these should work:
1. MsgBox ComboBox2.Value & " " & ComboBox2.List(ListIndex, 1)
if BoundColumn = 1 and ALPHABET in selected row
2. MsgBox ComboBox2.List(2,0) & " " & ComboBox2.List(2, 1)
if ALPHABET in the 3rd row (2nd since counting starts with 0)

Merjet





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
Add 2nd Column to ComboBox Justin[_14_] Excel Programming 4 September 14th 06 06:34 PM
How do I add 1 column, refering to another column milleroy Excel Discussion (Misc queries) 0 January 27th 06 02:54 PM
Multiple column Combobox JM[_8_] Excel Programming 2 January 9th 06 09:58 AM
How to get the values using a condition refering to the other column ramana Excel Worksheet Functions 2 October 28th 05 12:54 PM
Multi Column ComboBox Steve Roberts Excel Programming 0 March 29th 05 07:17 PM


All times are GMT +1. The time now is 10:58 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"