I am trying to populate a combobox when it is clicked (dropped down). I tried this:
When I click the box, it does drop down and show the two items in the list, but when I select (click) one of the items, the drop down list goes away (as it should) but the combobox is empty (it does not display "Test1" if that is the one I clicked, etc). If I remove the Clear call, it works correctly, but obviously ever time I click the box the list length gets incremented by 2 (which is bad).Please Login or Register to view this content.
In my real code I am populating this box from a range of cells specified by another combobox, so I don't have the option of just setting the InputRange or something like that, it has to be done dynamically.
I tried this in the GotFocus (instead of DropButtonClicked) as well, and it produces even weirder results. When I click the combobox, sometimes the list shows up like normal. Other times the list shows up as only one line with little tiny scroll buttons (more like a list box than combobox). Other times there are worse/strange rendering artifacts (like the box is kind of drawn but not quite). I'm guess that this again is due to the .Clear call at the beginning of the function?
Any suggestions on how to do this properly? I'm using Excel 2010.
Thanks!
David
Bookmarks