ActiveX ComboBox Issues

LDale

New Member
Joined
Apr 2, 2011
Messages
26
I have a ActiveX ComboBox and the box is showing one of the items the list of items. When i try select from the box it flash another box and does nothing.
In design mode i can see and select items in the ComboBox object which then changes the ComboBox. Why can't I just select from the omboBox itself?
 

Some videos you may like

Excel Facts

Can you sort left to right?
To sort left-to-right, use the Sort dialog box. Click Options. Choose "Sort left to right"

Yongle

Well-known Member
Joined
Mar 11, 2015
Messages
6,074
Office Version
365
Platform
Windows
Perhaps some of your code is conflicting
- do you have more than one event macro associated with the combobox?

What do you want to do with the selected value from the combobox? (how do you want to use it?)

Here is a simple way to start which is guaranteed to work
- build from there changing one thing at a time, making sure it works before moving on.

To test the code
- click on the combobox
- select an item from the list
- click on any cell in the worksheet
- combobox value returned to message box

Before doing that
1. Add a NEW sheet
2. Place values into range A1:A5 (which is used to populate the combobox)
3. Insert active-x combobox in the sheet(check that it is Combobox1)
4. Place the code below in the SHEET module
5. Make sure that "Design Mode" is not active

Code:
Private Sub ComboBox1_GotFocus()
    ComboBox1.List = Me.Range("A1:A5").Value
End Sub

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
    MsgBox ComboBox1.Value, , "Value is:"
End Sub
 
Last edited:

Watch MrExcel Video

Forum statistics

Threads
1,099,913
Messages
5,471,471
Members
406,764
Latest member
ExcelMaker007

This Week's Hot Topics

Top