ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Glorified search function (https://www.excelbanter.com/excel-programming/386052-glorified-search-function.html)

kaiser

Glorified search function
 
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....


kaiser

Glorified search function
 
On Mar 26, 2:48 pm, "kaiser" wrote:
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)


NickHK

Glorified search function
 
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

"kaiser" wrote in message
oups.com...
On Mar 26, 2:48 pm, "kaiser" wrote:
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)




arno

Glorified search function
 
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


merjet

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

Hth,
Merjet



All times are GMT +1. The time now is 07:56 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com