search macro

P

pinmaster

Hi, does anyone know how to make a macro that would search for text tha
is in a cell?...Here's what I have, in A2 I have inserted a validatio
list and at the end of the cell I made a command button from the form
toolbox and would like to attach a macro that would search for what i
in cell A2, there are multiple entries for each name in the list so i
would have to find them one at a time and then go back to the top i
there are no more to be found down in the worksheet!

Thanks
Jean-Guy Collette
Canad
 
H

Harald Staff

Hi Jean-Guy

Record a macro while performing it with Edit > Find menu and you're pretty
much done.
 
H

Harald Staff

"Pretty much done" is not "completely working". In what way does which code
not work ?
 
P

pinmaster

Ok. here's what I did.....I clicked on "record new macro" and then
selected a name from the list in cell A2, copied it, clicked on "edit"
"find" paste and then search, closed the window and stopped th
macro!...but even if I change the name in the list, it only searche
for the one that I originally copied!

Jean-Gu
 
H

Harald Staff

So it's 99% done then. Told ya :)
Replace what looks like something like this

Cells.Find(What:="Jean",

with exactly this

Cells.Find(What:=Range("A2").Value,
 
P

pinmaster

Ok...I did EXCACTLY :) what you said, still wasn't working, so then
Opened up the macro and deleted the first few lines and *voila*, I go
my search button!.... a big thank you for you patience man, I know i
wasn't easy, much apreciated. :)

Best Regards
Jean-Guy Collette
Canad
 
H

Harald Staff

pinmaster > said:
Ok...I did EXCACTLY :) what you said, still wasn't working, so then I
Opened up the macro and deleted the first few lines and *voila*, I got
my search button!.... a big thank you for you patience man, I know it
wasn't easy, much apreciated. :)

Glad to hear that. Thank you for the feedback.

Best wishes Harald
Followup to newsgroup only please
 

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