View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Andrei Andrei is offline
external usenet poster
 
Posts: 53
Default Need macro that transforms key words into predefined numbers

Let's say i have a column with the following cells :

A1 : house
A2 : garden
A3 : room
A4 : garden
A5: bedroom
A6 : garden
A7 : bedroom

I need a macro which transforms the words into predefined numbers . So the
results in column B should be like this

B1 : 1
B2 : 2
B3 : 3
B4 : 2
B5 : 4
B6 : 2
B7 : 4

Most likely , in my case , the cells contain only one word . What about if a
cell contains the key word and other words as well ( words which are not key
words ) . Something like this :

A1 : My house is a cottage
A2 : What a beautiful garden
A3 : Go to your room
A4 : I sold my garden yesterday
A5: I need another bedroom
A6 : I like my garden very much
A7 : Go to your bedroom and wash the floor

I would like the result to be the same as in the first case .

A1 : house
A2 : garden
A3 : room
A4 : garden
A5: bedroom
A6 : garden
A7 : bedroom

Can this be done ?