VLOOKUP, but different

C

Cooz

Hi everyone,

I have a table on Sheet1 with strings in column A. Say for simplicity's sake
that they are colours.

A
red
blue
purple
yellow
black

In addition I have this macro, that, when run, reads rows on a table on
Sheet2 and fills B1 on Sheet1 with the contents of the fourth cell in the
read row. As soon as the value of B1 changes, I need to determine whether B1
_contains_ a string that is present in column A. In this case the found value
in column A should be copied to C1.

For example: The macro runs. B1 gets this value: "no cure for the blues". C1
should have the value "blue". The macro processes the next line. B1 gets this
value: "movies by peter greenaway" C1 should become blank. The macro
processes the next line. B1 gets this value: "boredom". C1 should get the
value "red".

I know how to do this in code, but this slows down the macro considerably.
Is there a worksheet function that I can place in C1 which does the trick,
and if so: which one? Perhaps some fancy use of SUMPRODUCT?

Thank you,
Cooz
 

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