View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Ron Rosenfeld Ron Rosenfeld is offline
external usenet poster
 
Posts: 5,651
Default Pattern match and grouped items


On Thu, 2 Jul 2009 18:46:14 -0700 (PDT), SauQ wrote:

Dear all

I have in :

-- Column A, a list of items say,


1 YORK A/COND
2 SANYO 1.0HP air-cond
3 CANON laser printer (model : L-P'TER*LBP-3050)
4 EPSON - Batching system printer
5 EPSON - Dot matrix printer
6 Nokia 1200 - handphone
7 HP printer
8 Panasonic K Printer
9 Panasonic X printer
10 Panasonic P-P1121 printer
11 Nokia N6070 handphone
12 Nokia 1200 handphone
13 Microphone
14 Panasonic printer
15 2nd hand hand phone

I am looking for a function / vba / anyway if excel can do a pattern
match
and :

- highlight (with color) items 1,2
and return in column B the word "cond" (i.e. same word contains in
both the the items)

- highlight (with different color) items 3,4,5,7,8,9,10,14
and return in column C the word "printer" (i.e. same word contains in
all these items)

- highlight (with different color) items 6,11,12,13,15
and return in column D the word "phone" (i.e. same word contains in
all these items)

Any suggestion or help on this is greatly appreciated.

Thanks heaps ! Everyone.
SauQ


How do you define which of the words or portions of a word you want to match?

Examples: EPSON is found in lines 4,5
printer is found in multiple lines and the range containing
"printer" overlaps the range containing "EPSON".

How to color ranges with overlapping duplicates?

Also, you write that you want to match the word "phone", yet that is
only a portion of the word "handphone" in a number of the lines you are
matching.

--ron