stanleydgromjr
Banned
- Joined
- Jul 30, 2006
- Messages
- 3,656
Re: June/July 2008 Challenge of the Month
Here you go.
Before my macro:
After the macro:
Have a great day,
Stan
Here you go.
Before my macro:
Excel Workbook | |||||||
---|---|---|---|---|---|---|---|
A | B | C | D | E | |||
1 | Phrases | Assigned to | Keyword | Assigned to | |||
2 | the ocean is blue | blue | Joe | ||||
3 | I like this blue shirt | red | Bob | ||||
4 | blue is my favorite color | yellow | Mary | ||||
5 | the ocean is red | pink | Fred | ||||
6 | I like this red shirt | orange | Ralph | ||||
7 | red is my favorite color | brown | Lora | ||||
8 | the ocean is yellow | white | Tracy | ||||
9 | I like this yellow shirt | lavendar | Earl | ||||
10 | yellow is my favorite color | magenta | Jeny | ||||
11 | the ocean is pink | ||||||
12 | I like this pink shirt | ||||||
13 | redditch | ||||||
14 | the ocean is blue | ||||||
15 | I like this blue shirt | ||||||
16 | blue is my favorite color | ||||||
17 | the ocean is red | ||||||
18 | I like this red shirt | ||||||
19 | red is my favorite color | ||||||
20 | the ocean is yellow | ||||||
21 | I like this yellow shirt | ||||||
22 | yellow is my favorite color | ||||||
23 | the ocean is pink | ||||||
24 | I like this pink shirt | ||||||
25 | redditch | ||||||
26 | the ocean is blue | ||||||
27 | I like this blue shirt | ||||||
28 | blue is my favorite color | ||||||
29 | the ocean is red | ||||||
30 | I like this red shirt | ||||||
31 | red is my favorite color | ||||||
32 | the ocean is yellow | ||||||
33 | I like this yellow shirt | ||||||
34 | yellow is my favorite color | ||||||
35 | the ocean is pink | ||||||
36 | I like this pink shirt | ||||||
37 | redditch | ||||||
Sheet1 |
After the macro:
Excel Workbook | |||||||
---|---|---|---|---|---|---|---|
A | B | C | D | E | |||
1 | Phrases | Assigned to | Keyword | Assigned to | |||
2 | the ocean is blue | Joe | blue | Joe | |||
3 | I like this blue shirt | Joe | red | Bob | |||
4 | blue is my favorite color | Joe | yellow | Mary | |||
5 | the ocean is red | Bob | pink | Fred | |||
6 | I like this red shirt | Bob | orange | Ralph | |||
7 | red is my favorite color | Bob | brown | Lora | |||
8 | the ocean is yellow | Mary | white | Tracy | |||
9 | I like this yellow shirt | Mary | lavendar | Earl | |||
10 | yellow is my favorite color | Mary | magenta | Jeny | |||
11 | the ocean is pink | Fred | |||||
12 | I like this pink shirt | Fred | |||||
13 | redditch | Bob | |||||
14 | the ocean is blue | Joe | |||||
15 | I like this blue shirt | Joe | |||||
16 | blue is my favorite color | Joe | |||||
17 | the ocean is red | Bob | |||||
18 | I like this red shirt | Bob | |||||
19 | red is my favorite color | Bob | |||||
20 | the ocean is yellow | Mary | |||||
21 | I like this yellow shirt | Mary | |||||
22 | yellow is my favorite color | Mary | |||||
23 | the ocean is pink | Fred | |||||
24 | I like this pink shirt | Fred | |||||
25 | redditch | Bob | |||||
26 | the ocean is blue | Joe | |||||
27 | I like this blue shirt | Joe | |||||
28 | blue is my favorite color | Joe | |||||
29 | the ocean is red | Bob | |||||
30 | I like this red shirt | Bob | |||||
31 | red is my favorite color | Bob | |||||
32 | the ocean is yellow | Mary | |||||
33 | I like this yellow shirt | Mary | |||||
34 | yellow is my favorite color | Mary | |||||
35 | the ocean is pink | Fred | |||||
36 | I like this pink shirt | Fred | |||||
37 | redditch | Bob | |||||
Sheet1 |
Code:
Option Explicit
Sub ColorAssignedTo()
'
' ColorAssignedTo Macro
' Macro created 06/21/2008 by Stanley D. Grom, Jr.
'
Dim LRA&
Dim LRD&
Application.ScreenUpdating = False
LRA& = Cells(Rows.Count, 1).End(xlUp).Row
LRD& = Cells(Rows.Count, 4).End(xlUp).Row
With Range("B2")
.FormulaArray = "=INDEX(R2C5:R" & LRD& & "C5,MATCH(1,SEARCH(""*""&R2C4:R" & LRD& & "C4&""*"",RC[-1]),0))"
.Copy Range("B3:B" & LRA&)
End With
With Range("B2:B" & LRA&)
.Copy
.Value = .Value
End With
Application.CutCopyMode = False
Application.ScreenUpdating = True
End Sub
Have a great day,
Stan