Hello, I'm trying to create a macro that will look At sheet1 "Column A" and go down each cell with data and if on Sheet1 Range("A6").value = "James" then look at sheet2 and delete the entire row if it finds "James" on sheet2.
If Range("A10").value = "Jane" then delete the entire row if it finds "Jane" on sheet2 etc.
Like This
To This
Sheet2 will look like this
Any ideas?
If Range("A10").value = "Jane" then delete the entire row if it finds "Jane" on sheet2 etc.
Like This
Book1 | |||||||
---|---|---|---|---|---|---|---|
A | B | C | D | E | |||
1 | Report | ||||||
2 | 8-Feb | ||||||
3 | User | ||||||
4 | |||||||
5 | Name | Order | Amount | ||||
6 | James | 10 | 100 | ||||
7 | James | 15 | 150 | ||||
8 | James | 15 | 150 | ||||
9 | James | 15 | 150 | ||||
10 | |||||||
11 | |||||||
12 | |||||||
13 | John | 20 | 200 | ||||
14 | John | 20 | 200 | ||||
15 | John | 20 | 200 | ||||
16 | John | 20 | 200 | ||||
17 | John | 20 | 200 | ||||
18 | John | 20 | 200 | ||||
19 | John | 20 | 200 | ||||
20 | John | 20 | 200 | ||||
21 | |||||||
22 | |||||||
23 | |||||||
24 | Jane | 20 | 200 | ||||
25 | Jane | 20 | 200 | ||||
26 | Jane | 20 | 200 | ||||
27 | Jane | 20 | 200 | ||||
28 | Jane | 20 | 200 | ||||
29 | Jane | 20 | 200 | ||||
30 | Jane | 20 | 200 | ||||
31 | Jane | 20 | 200 | ||||
32 | |||||||
33 | |||||||
34 | |||||||
35 | |||||||
36 | |||||||
37 | |||||||
38 | |||||||
Sheet1 |
To This
Book1 | ||||||
---|---|---|---|---|---|---|
A | B | C | D | |||
1 | Report | |||||
2 | 8-Feb | |||||
3 | User | |||||
4 | ||||||
5 | Name | Order | Amount | |||
6 | John | 20 | 200 | |||
7 | John | 20 | 200 | |||
8 | John | 20 | 200 | |||
9 | John | 20 | 200 | |||
10 | John | 20 | 200 | |||
11 | John | 20 | 200 | |||
12 | John | 20 | 200 | |||
13 | John | 20 | 200 | |||
14 | ||||||
15 | ||||||
Sheet1 |
Sheet2 will look like this
Book1 | |||||
---|---|---|---|---|---|
A | B | C | |||
1 | Names | ||||
2 | James | ||||
3 | James | ||||
4 | James | ||||
5 | Jane | ||||
6 | Jane | ||||
7 | Jane | ||||
Sheet2 |
Any ideas?
Last edited: