List Box search

dark11984

New Member
Joined
Sep 9, 2008
Messages
10
Hi Guys, I have a list box full of products and I know that you can enter the first letter of the product and it will skip to those products.

I would like to take this a step further and be able to type part of or the full product name in a cell and have the list box skip to that product. Does anyone know a code to do this?

example

list box
beads
beam
bracket
nails20
nails30

If I type "brac" it will skip to bracket or if I type "nails20" it will skip to nails20.

Thanks in advance for your responses.

dark11984
 

Excel Facts

Fastest way to copy a worksheet?
Hold down the Ctrl key while dragging tab for Sheet1 to the right. Excel will make a copy of the worksheet.
You can conviniently use the Worksheet_Change event for this as follows:

Code:
Private Sub Worksheet_Change(ByVal Target As Range)
    On Error Resume Next
    
    If Target.Address = Range("A1").Address Then
        
        ListBox1 = Target
    End If
End Sub

Where A1 is the Cell you type the values in and ListBox1 the name of your Listbox- Change these as required.

Regards.
 
Upvote 0
Thanks Jaafar, That works great if you type the full product code.

Is there anyway if you type part of the word you can get the list box to scroll to the products beginning with the letters you typed?
 
Upvote 0
Have you looked into the MatchEntry property of the list box? then you don't have to type in a cell you can just type it in the box. The behavior you want is MatchEntry = 1
 
Upvote 0

Forum statistics

Threads
1,215,427
Messages
6,124,830
Members
449,190
Latest member
rscraig11

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top