I was hoping to get a macro for the following two-part function. Thank you.
Trying to copy and paste Based on first occurrence in the cells.
The data is in sheet2.
Hoping for case-insensitive match.
Part I
When the cells below TITLE2 start with "After" or "Below", want the rows to be copied and pasted above TITLE2 row, below the row where column O cell is identical.
Part II
When the cells below TITLE2 start with "Before" or "Above", want the rows to be copied and pasted above TITLE2 row, above the row where column O cell is identical.
I can use formulas, but I would like to use VBA if possible.
Here is the example
Before:
After:
Trying to copy and paste Based on first occurrence in the cells.
The data is in sheet2.
Hoping for case-insensitive match.
Part I
When the cells below TITLE2 start with "After" or "Below", want the rows to be copied and pasted above TITLE2 row, below the row where column O cell is identical.
Part II
When the cells below TITLE2 start with "Before" or "Above", want the rows to be copied and pasted above TITLE2 row, above the row where column O cell is identical.
I can use formulas, but I would like to use VBA if possible.
Here is the example
Before:
Book3 | ||||||
---|---|---|---|---|---|---|
O | P | Q | R | |||
1 | Theater: | |||||
2 | Movie: | |||||
3 | ||||||
4 | ||||||
5 | TITLE1 | |||||
6 | ||||||
7 | Eros | Eros: | 4 | Eros: Dunn | ||
8 | Regal | Regal: | 4 | Regal: Superman | ||
9 | Metro | Metro: | 4 | Metro: Batman | ||
10 | Minerva | Minerva: | 4 | Minerva: Starwars | ||
11 | ||||||
12 | ||||||
13 | TITLE2 | |||||
14 | Eros shows Superman nextweek. Delim4. | |||||
15 | Metro shows Dunn next month. Delim3. Closed today. | |||||
16 | Delim2. Minerva is showing Abba. | |||||
17 | Metro | Place | 4 | Before Metro Roxi shows Cars. | ||
18 | Eros | Place | 4 | After Eros Strand shows Abba. | ||
19 | Eros | Place | 4 | After Eros Mandir shows Sholay | ||
20 | Metro | Place | 4 | Before Metro Opera House shows Shor | ||
Sheet2 |
After:
Book3 | ||||||
---|---|---|---|---|---|---|
O | P | Q | R | |||
1 | Theater: | |||||
2 | Movie: | |||||
3 | ||||||
4 | ||||||
5 | TITLE1 | |||||
6 | ||||||
7 | Eros | Eros: | 4 | Eros: Dunn | ||
8 | Eros | Place | 4 | After Eros Strand shows Abba. | ||
9 | Eros | Place | 4 | After Eros Mandir shows Sholay | ||
10 | Regal | Regal: | 4 | Regal: Superman | ||
11 | Metro | Place | 4 | Before Metro Roxi shows Cars. | ||
12 | Metro | Place | 4 | Before Metro Opera House shows Shor | ||
13 | Metro | Metro: | 4 | Metro: Batman | ||
14 | Minerva | Minerva: | 4 | Minerva: Starwars | ||
15 | ||||||
16 | ||||||
17 | TITLE2 | |||||
18 | Eros shows Superman nextweek. Delim4. | |||||
19 | Metro shows Dunn next month. Delim3. Closed today. | |||||
20 | Delim2. Minerva is showing Abba. | |||||
21 | Metro | Place | 4 | Before Metro Roxi shows Cars. | ||
22 | Eros | Place | 4 | After Eros Strand shows Abba. | ||
23 | Eros | Place | 4 | After Eros Mandir shows Sholay | ||
24 | Metro | Place | 4 | Before Metro Opera House shows Shor | ||
Sheet2 |