Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
active combobox - possible to configure as display value andcoordinate value?
You need to use the ColumnCount property Thanks Garry |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
MultiColumn ComboBox Display | Excel Programming | |||
How to display the active row number | Excel Programming | |||
Auto Populate sheet name of active workbook in Combobox in Command | Excel Programming | |||
Combobox & Display | Excel Programming | |||
Adding Items To Active X ComboBox on Sheet | Excel Programming |