Forums
New posts
Search forums
Members
Current visitors
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Menu
Log in
Register
Install the app
Install
Forums
Archive
Newsgroup Archive
Excel Newsgroups
Excel Programming
active combobox - possible to configure as display value andcoordinate value?
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
Reply to thread
Message
[QUOTE="GS, post: 7426887"] I have a active combobox that lists colors 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 [URL]http://www.eternal-september.org[/URL] Classic VB Users Regroup! comp.lang.basic.visual.misc microsoft.public.vb.general.discussion [/QUOTE]
Verification
Post reply
Forums
Archive
Newsgroup Archive
Excel Newsgroups
Excel Programming
active combobox - possible to configure as display value andcoordinate value?
Top