#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 812
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 58
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Listbox 2 takes the value of Listbox 1 Illya Teideman Excel Discussion (Misc queries) 3 April 10th 07 03:20 PM
listbox B conditional of input in Listbox A Kim K Excel Discussion (Misc queries) 1 October 31st 06 08:27 PM
Listbox B if LIstbox A equals Kim K Excel Discussion (Misc queries) 2 October 31st 06 07:03 PM
Is refreshing listbox rowsource in listbox click event possible? Jeremy Gollehon[_2_] Excel Programming 4 September 25th 03 06:45 PM
Sorting ListBox results or transposing ListBox values to other cells for sorting Rob[_8_] Excel Programming 1 July 9th 03 04:35 AM


All times are GMT +1. The time now is 01:04 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"