Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 59
Default active combobox - possible to configure as display value andcoordinate value?

I have a active combobox that lists colors

red
green
purple

When the user select the color and the _change event fires I want to see
a secondary value related to the color. For example, if red is selected I want
to read "fire", or if green is selected, I want to read "grass".

I want this information contained within the control. Is this possible? Like a drop down in HTML that has a name and value. You don't see the value, just the name.

thank you
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,514
Default active combobox - possible to configure as display value and coordinate value?

I have a active combobox that lists colors

red
green
purple

When the user select the color and the _change event fires I want to
see a secondary value related to the color. For example, if red is
selected I want to read "fire", or if green is selected, I want to
read "grass".

I want this information contained within the control. Is this
possible? Like a drop down in HTML that has a name and value. You
don't see the value, just the name.

thank you


You need to use the ColumnCount property, set the color column as the
only one to display, set the value column as the BoundColumn. The value
in the BoundColumn will always be returned when an item is selected...

Put the following in the code module for the sheet containing
ComboBox1:

Option Explicit

Private Sub ComboBox1_Change()
With Me.ComboBox1
If .Text < "" Then MsgBox .Value
End With
End Sub

Private Sub Worksheet_Activate()
Dim vList
vList = Me.Range("A2:B3")
With Me.ComboBox1
.ColumnCount = 2
.BoundColumn = 1
.ColumnWidths = "0,25" '//edit to suit
If .ListCount = 0 Then .List = vList
End With
End Sub

Insert the following in A2:B3 on the sheet containing ComboBox1...

fire red
water blue

Now cause the Sheet's _Activate event to fire so the combobox gets
setup & populated. Select a color and see what displays in the msgbox.

--
Garry

Free usenet access at http://www.eternal-september.org
Classic VB Users Regroup!
comp.lang.basic.visual.misc
microsoft.public.vb.general.discussion


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 59
Default active combobox - possible to configure as display value andcoordinate value?


You need to use the ColumnCount property


Thanks Garry
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,514
Default active combobox - possible to configure as display value and coordinate value?

You need to use the ColumnCount property

Thanks Garry


Glad to help...

--
Garry

Free usenet access at http://www.eternal-september.org
Classic VB Users Regroup!
comp.lang.basic.visual.misc
microsoft.public.vb.general.discussion


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
MultiColumn ComboBox Display Minitman Excel Programming 4 June 1st 08 05:54 AM
How to display the active row number [email protected] Excel Programming 4 July 11th 07 05:19 PM
Auto Populate sheet name of active workbook in Combobox in Command Bhavtosh Excel Programming 2 January 24th 05 09:03 AM
Combobox & Display Bhuktar S[_12_] Excel Programming 1 October 2nd 04 01:14 AM
Adding Items To Active X ComboBox on Sheet Dan Gesshel Excel Programming 3 October 20th 03 01:02 PM


All times are GMT +1. The time now is 08:58 PM.

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"