Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Listbox
I have changed my list box MatchEntry to fmMatchEntryComplete so that I can
type in complete words to find a match in my list. What I would like to do is to replicate this search ability but have the listbox displaying matched entries from a textbox using the textbox change event to initialize the search. So instead of typing the search string in the list box I would type it in the textbox but have the listbox responding as though I had typed the string in the listbox. Can this be done? |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Listbox
Your post wasn't real clear to me since a ListBox is
not for typing in entries. But suppose all the ListBox candidates are in Sheets("Sheet1").Range("A1:A20"). Then the following code should work. Private Sub TextBox1_Change() ListBox1.Clear For Each c In Sheets("Sheet1").Range("A1:A20") If TextBox1.Text = Left(c, Len(TextBox1.Value)) Then ListBox1.AddItem c End If Next c End Sub HTH, Merjet |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Listbox
To add, maybe you can adapt some ideas from my page:
http://www.rubbershoe.com/listboxlookup.htm "Stephen" wrote in message ... I have changed my list box MatchEntry to fmMatchEntryComplete so that I can type in complete words to find a match in my list. What I would like to do is to replicate this search ability but have the listbox displaying matched entries from a textbox using the textbox change event to initialize the search. So instead of typing the search string in the list box I would type it in the textbox but have the listbox responding as though I had typed the string in the listbox. Can this be done? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Listbox 2 takes the value of Listbox 1 | Excel Discussion (Misc queries) | |||
listbox B conditional of input in Listbox A | Excel Discussion (Misc queries) | |||
Listbox B if LIstbox A equals | Excel Discussion (Misc queries) | |||
Is refreshing listbox rowsource in listbox click event possible? | Excel Programming | |||
Sorting ListBox results or transposing ListBox values to other cells for sorting | Excel Programming |