Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Dynamically updating Combobox
In my form, I have a combobox which includes a list of names harvested
from several worksheets and allows the user to select one. I'd like for the combobox to operate like this: * Allows user to pick a name from the list (preferably with match first letter option) * Allows user to enter a name, and once done, add that to the combobox list and sort it. I find that the combobox_change event keeps firing, so I end up with a list of partial names. If I add "Roger" to the list, i'll also end up with "r", "ro", "rog" and "roge" in the list. Thanks, Darren. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Dynamically updating Combobox
Had the same problem today. Here is the example I used:
Private Sub ComboBox1_Change() Dim strRange As String If ComboBox1.ListIndex -1 Then strRange = ComboBox1 Label2.Caption = strRange strRange = Replace(strRange, " ", "_") With ComboBox2 .RowSource = vbNullString .RowSource = strRange .ListIndex = 0 End With Else Label2.Caption = "Associated Items" End If End Sub You have to select the first cell in a column and go to InsertNameDefine in order to define what the name of your data is. "Darren Hill" wrote: In my form, I have a combobox which includes a list of names harvested from several worksheets and allows the user to select one. I'd like for the combobox to operate like this: * Allows user to pick a name from the list (preferably with match first letter option) * Allows user to enter a name, and once done, add that to the combobox list and sort it. I find that the combobox_change event keeps firing, so I end up with a list of partial names. If I add "Roger" to the list, i'll also end up with "r", "ro", "rog" and "roge" in the list. Thanks, Darren. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Min & Max of a dynamically updating cell value | Excel Programming | |||
dynamically lengthened combobox | Excel Programming | |||
creating a combobox dynamically on an excel sheet | New Users to Excel | |||
No replies, so again : How to add Combobox to cell dynamically? | Excel Programming | |||
Dynamically adding data to a Combobox? | Excel Programming |