Glorified search function

K

kaiser

Hello,

I hope that someone can help me. I am trying to create a search
function that searches through a single column on the following
manner.

Column A:

Beach Boys
Beatles
Dire Straits



When the user enters (into either a cell or a form, cell probably
easiest) a letter the macro must search for words starting with that
letter, when the user enters another letter the search must refine
that list.

For example:

If the user enters "b"

Beach Boys
Beatles

will be displayed.

When the user enters "beat"

Then only Beatles will be displayed. Expect the macro must happen
without the user pressing a button, ie, just when the user enters the
search string/letter into a cell then the search function must kick
in.

You know iTunes? Well, pretty much like the iTunes search function.

Thanks....
 
K

kaiser

Hello,

I hope that someone can help me. I am trying to create a search
function that searches through a single column on the following
manner.

Column A:

Beach Boys
Beatles
Dire Straits

When the user enters (into either a cell or a form, cell probably
easiest) a letter the macro must search for words starting with that
letter, when the user enters another letter the search must refine
that list.

For example:

If the user enters "b"

Beach Boys
Beatles

will be displayed.

When the user enters "beat"

Then only Beatles will be displayed. Expect the macro must happen
without the user pressing a button, ie, just when the user enters the
search string/letter into a cell then the search function must kick
in.

You know iTunes? Well, pretty much like the iTunes search function.

Thanks....

Just for further clarity - I have written a macro that does the above
when the cell value has changed, but I want to ahve the search
function run as EACH BUTTON IS PRESSED and not when enter is pressed
(ie, when the cell value is changed)
 
N

NickHK

This will not work from a cell, as macros cannot run when in Edit mode.
Put the code to fire when a text box changes instead. A userform maybe
easier.

NickHK
 
A

arno

maybe the user should press enter whenever he wants to start filtering,
the macro should filter and then edit the cell by pressing F2 so that
the user can add characters to the string press enter etc. etc.

something like

Sub Makro1()

'your code here

Range("C8").Select
SendKeys "{F2}"
End Sub

arno
 
M

merjet

Put a ComboBox on a UserForm. Set its RowSource property to your list.
Set its MatchEntry property to 1.

Hth,
Merjet
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top