Sign in with
Sign up | Sign in
Your question

How to select item using combo-box in ms-excel?

Last response: in Applications
Share
June 5, 2011 12:55:39 PM

I'm trying to populate a combobox (in excel using vba) which ad items from a range.
It's doing that.
But when I click an item from the dropdown list, it's not showing any item as it's text. (it's text is blank)
If i ad a code to display a msgbox (with anything) in the click event, it's showing the selected item in the combobox!!
The code I used are below:
---
Private Sub ComboBox1_DropButtonClick()
ComboBox1.Clear

For i = 1 To 5
ComboBox1.AddItem Worksheets("Sheet1").Range("a" & i)
Next
End Sub

Private Sub ComboBox1_Click()
'MsgBox “anything”
End Sub
----

The msgbox is not required and I can find no reason of this behavior.
can any one pls help me..

July 13, 2012 4:18:11 PM

[Hi polashd,

This is probably way too late to help you but it may help someone else.

I did what you did and of course got the same result. Put your routine in Initialize, not DropButtonClick.

For a full explanation see http://www.contextures.com/Excel-VBA-ComboBox-Lists.htm...

Hope this helps others.
!