PC Review


Reply
Thread Tools Rate Thread

How do I perform a partial word search in a cell ?

 
 
=?Utf-8?B?Um9oYW5QNw==?=
Guest
Posts: n/a
 
      12th Oct 2006
I have a list of data (just one column).
It has a list of about 800 or more products.
On a seperate worksheet I want to enter products one after the other.
When entering part of it, eg. cil or pen
it should come up with a dropdown box at the side of the cell (like with
data validation dropdown box), with the values that 'contain' or *pen*
so some of the items appearing would be pen, pencil, pendant for example.

I think this would involve a macro that picks up each keystroke as its
entered into the cell (there are about 50 rows that may have this data
entered into it).
it would do a search with every keypress for contains: *pen*
and then use the search values in a data validation dropdown box for that
particular cell. This would be of GREAT help if you can help me out with
this, or even part of it!
Thanks!

 
Reply With Quote
 
 
 
 
Zone
Guest
Posts: n/a
 
      12th Oct 2006
Rohan, you might like this file:
http://savefile.com/files/152644
After downloading, open the file and display Sheet2. Select an empty
cell in column A. Type in a few letters and select a matching word
from the list. This uses the Worksheet_SelectionChange event for
Sheet2. Hope it helps! James
RohanP7 wrote:
> I have a list of data (just one column).
> It has a list of about 800 or more products.
> On a seperate worksheet I want to enter products one after the other.
> When entering part of it, eg. cil or pen
> it should come up with a dropdown box at the side of the cell (like with
> data validation dropdown box), with the values that 'contain' or *pen*
> so some of the items appearing would be pen, pencil, pendant for example.
>
> I think this would involve a macro that picks up each keystroke as its
> entered into the cell (there are about 50 rows that may have this data
> entered into it).
> it would do a search with every keypress for contains: *pen*
> and then use the search values in a data validation dropdown box for that
> particular cell. This would be of GREAT help if you can help me out with
> this, or even part of it!
> Thanks!


 
Reply With Quote
 
=?Utf-8?B?Um9oYW5QNw==?=
Guest
Posts: n/a
 
      12th Oct 2006
That was really helpful thanks!

I'm still looking to make it a bit less interface and more functionality.
I'm sure this will help.

What I want to do now is to double click on a cell,
have a listbox popup with all prodcuts, and then as i type each letter,
allow that code to work and display the search results in an updating list
box, next to the cell. I'd greatly appreciate any help on this!

 
Reply With Quote
 
Zone
Guest
Posts: n/a
 
      13th Oct 2006
Rohan, you should be able to replace the Selection Change line with
this line
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel
As Boolean)
to fire on a double-click. To change this, display the spreadsheet.
Right-click on its tab (bottom of screen) and select View Code.
Replace the SelectionChange line of code with the one above. I'm
buried in work and can't reply more fully at the moment. James

RohanP7 wrote:
> That was really helpful thanks!
>
> I'm still looking to make it a bit less interface and more functionality.
> I'm sure this will help.
>
> What I want to do now is to double click on a cell,
> have a listbox popup with all prodcuts, and then as i type each letter,
> allow that code to work and display the search results in an updating list
> box, next to the cell. I'd greatly appreciate any help on this!


 
Reply With Quote
 
=?Utf-8?B?Um9oYW5QNw==?=
Guest
Posts: n/a
 
      14th Oct 2006
Thanks James, for your reply!

I got the double click working for a specified range of cells.
Using Intersect method with Target.

I'm looking to tweak the function a bit, i know what i want but i dont know
how to do it.

Firstly, I want to type the search into the cell itself instead of the text
box in the form, so that it updates the search with each keypress. Also I
would like to try and see how this works:

Populate a listbox with the search results for that cell.

I have a slight prob. with the search. It displays all searches in
alphabetical order. if I have a product called for example "Amazing Pen" and
then another called Pen. when I type Pen, it display 'Amazing Pen' before
'Pen', is there a way to modify it so that if I type 'Pen' It would show Pen
before amazing pen.
or in other words, if I type something then it should display exact matches
first ?

***When it comes to the search, "optimally", I would like the same search
flexibility as the 'J' key in winamp. With that it's possible to type any
portion of the search, in any order and it will display it.***

Any help would be veerrryy much appreciated. The help I've gotten so far has
been fantastic!
Thanks!

 
Reply With Quote
 
Tom Ogilvy
Guest
Posts: n/a
 
      15th Oct 2006
When typing in a cell, for any practical purpose, macros don't run.

You might look at using the selection change event to pop up a dialog with
the focus set to the control so you can start typing.



--
Regards,
Tom Ogilvy


"RohanP7" <(E-Mail Removed)> wrote in message
news:765CA637-74CA-4CC9-8C10-(E-Mail Removed)...
> Thanks James, for your reply!
>
> I got the double click working for a specified range of cells.
> Using Intersect method with Target.
>
> I'm looking to tweak the function a bit, i know what i want but i dont
> know
> how to do it.
>
> Firstly, I want to type the search into the cell itself instead of the
> text
> box in the form, so that it updates the search with each keypress. Also I
> would like to try and see how this works:
>
> Populate a listbox with the search results for that cell.
>
> I have a slight prob. with the search. It displays all searches in
> alphabetical order. if I have a product called for example "Amazing Pen"
> and
> then another called Pen. when I type Pen, it display 'Amazing Pen' before
> 'Pen', is there a way to modify it so that if I type 'Pen' It would show
> Pen
> before amazing pen.
> or in other words, if I type something then it should display exact
> matches
> first ?
>
> ***When it comes to the search, "optimally", I would like the same search
> flexibility as the 'J' key in winamp. With that it's possible to type any
> portion of the search, in any order and it will display it.***
>
> Any help would be veerrryy much appreciated. The help I've gotten so far
> has
> been fantastic!
> Thanks!
>



 
Reply With Quote
 
Zone
Guest
Posts: n/a
 
      16th Oct 2006
Rohan, as Tom said, just typing characters into a cell doesn't trigger
an Excel event. The only thing I know that works that way is
auto-complete. I haven't really explored auto-complete, so I don't
know what properties/methods it exposes to VBA, if any. Someone else
may have an idea on that. I think you might be happier with the
routine in its original form, but of course that's up to you. Anyway,
good luck and best regards, James
RohanP7 wrote:
> Thanks James, for your reply!
>
> I got the double click working for a specified range of cells.
> Using Intersect method with Target.
>
> I'm looking to tweak the function a bit, i know what i want but i dont know
> how to do it.
>
> Firstly, I want to type the search into the cell itself instead of the text
> box in the form, so that it updates the search with each keypress. Also I
> would like to try and see how this works:
>
> Populate a listbox with the search results for that cell.
>
> I have a slight prob. with the search. It displays all searches in
> alphabetical order. if I have a product called for example "Amazing Pen" and
> then another called Pen. when I type Pen, it display 'Amazing Pen' before
> 'Pen', is there a way to modify it so that if I type 'Pen' It would show Pen
> before amazing pen.
> or in other words, if I type something then it should display exact matches
> first ?
>
> ***When it comes to the search, "optimally", I would like the same search
> flexibility as the 'J' key in winamp. With that it's possible to type any
> portion of the search, in any order and it will display it.***
>
> Any help would be veerrryy much appreciated. The help I've gotten so far has
> been fantastic!
> Thanks!


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Partial word search in Outlook 2003 Jasper Recto Microsoft Outlook 1 15th Sep 2009 03:47 PM
Jump to Yahoo Mail with Active Cell Contents, and then perform asearch in the Search Mail Box Mike C Microsoft Excel Programming 0 15th Mar 2009 12:23 AM
how to use partial (word) search Vikky Microsoft Excel Programming 1 14th Jul 2006 01:12 PM
how to use partial (word) search Vikky Microsoft Excel Discussion 3 14th Jul 2006 01:01 PM
How to make a Partial Search Query or partial search function =?Utf-8?B?TGUgVHJhbg==?= Microsoft Access Getting Started 4 15th Jun 2004 09:43 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 06:19 PM.