An Quala
Board Regular
- Joined
- Mar 21, 2022
- Messages
- 146
- Office Version
- 2021
- Platform
- Windows
Hi, I need to delete the entire rows in 3 sheets based on the following criteria:
If
In Sheets. 'Sponsored Products Campaigns'
>If Column B does NOT have "Keyword" or "Product Targeting" OR
>If Column S does NOT have "enabled" OR
>If Column AS does NOT have "enabled" OR
>If Column AT does NOT have "enabled"
In Sheets. 'Sponsored Brands Campaigns'
>If Column B does NOT have "Keyword" or "Product Targeting" OR
>If Column Q does NOT have "enabled" OR
>If Column R does NOT have "running" or "other"
>If Column AY does NOT have "enabled"
In Sheets. 'Sponsored Display Campaigns'
>If Column B does NOT have "Audience Targeting" or "Product Targeting" OR
>If Column M does NOT have "enabled" OR
>If Column AL does NOT have "enabled" OR
>If Column AM does NOT have "enabled"
Then Delete the entire row.
NOTE: These all OPERATIONS are ORED means if any single criteria is met, I need to delete that entire row.
NOTE2: Please don't merge/combine code for all 3 sheets, as I will place these codes in a bigger code on different places, and depending on a condition, one will run and others won't.
NOTE3: Kindly use as minimum variables as possible as they mess up the bigger code.
NOTE4: I can't attach the full file as they has all 3 sheets, but for now I am attaching all separately in code format.
NOTE5: I know there are multiple method to achieve the same result, please consider the most efficient way to do that considering rows from 5k - 100k
Sponsored Products Campaigns
If
In Sheets. 'Sponsored Products Campaigns'
>If Column B does NOT have "Keyword" or "Product Targeting" OR
>If Column S does NOT have "enabled" OR
>If Column AS does NOT have "enabled" OR
>If Column AT does NOT have "enabled"
In Sheets. 'Sponsored Brands Campaigns'
>If Column B does NOT have "Keyword" or "Product Targeting" OR
>If Column Q does NOT have "enabled" OR
>If Column R does NOT have "running" or "other"
>If Column AY does NOT have "enabled"
In Sheets. 'Sponsored Display Campaigns'
>If Column B does NOT have "Audience Targeting" or "Product Targeting" OR
>If Column M does NOT have "enabled" OR
>If Column AL does NOT have "enabled" OR
>If Column AM does NOT have "enabled"
Then Delete the entire row.
NOTE: These all OPERATIONS are ORED means if any single criteria is met, I need to delete that entire row.
NOTE2: Please don't merge/combine code for all 3 sheets, as I will place these codes in a bigger code on different places, and depending on a condition, one will run and others won't.
NOTE3: Kindly use as minimum variables as possible as they mess up the bigger code.
NOTE4: I can't attach the full file as they has all 3 sheets, but for now I am attaching all separately in code format.
NOTE5: I know there are multiple method to achieve the same result, please consider the most efficient way to do that considering rows from 5k - 100k
Sponsored Products Campaigns
Dummy Bulk Data.xlsx | ||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
A | B | C | D | E | F | G | H | I | J | K | L | M | N | O | P | Q | R | S | T | U | V | W | X | Y | Z | AA | AB | AC | AD | AE | AF | AG | AH | AI | AJ | AK | AL | AM | AN | AO | AP | AQ | AR | AS | AT | AU | AV | |||
1 | Product | Entity | Operation | Campaign Id | Ad Group Id | Portfolio Id | Ad Id (Read only) | Keyword Id (Read only) | Product Targeting Id (Read only) | Campaign Name | Ad Group Name | Start Date | End Date | Targeting Type | State | Daily Budget | SKU | ASIN | Ad Group Default Bid | Bid | Keyword Text | Match Type | Bidding Strategy | Placement | Percentage | Product Targeting Expression | Impressions | Clicks | Click-through Rate | Spend | Sales | Orders | Units | Conversion Rate | Acos | CPC | ROAS | Campaign Name (Informational only) | Ad Group Name (Informational only) | Campaign State (Informational only) | Ad Group State (Informational only) | Ad Group Default Bid (Informational only) | Resolved Product Targeting Expression (Informational only) | |||||||
2 | Sponsored Products | Campaign | 51810182230962 | Portfolio1 | Campaign Name - Dummy | 20220131 | MANUAL | enabled | 100.0 | Dynamic bids - down only | 2739 | 10 | 0.37% | 5.0 | 0.0 | 0 | 0 | 0.0 | 0.0% | 0.5 | 0.0 | Campaign Name - Dummy | enabled | |||||||||||||||||||||||||||
3 | Sponsored Products | Bidding Adjustment | 51810182230962 | Dynamic bids - down only | placementProductPage | 0.0 | 2484 | 2 | 0.08% | 0.9 | 0.0 | 0 | 0 | 0.0 | 0.0% | 0.45 | 0.0 | Campaign Name - Dummy | enabled | |||||||||||||||||||||||||||||||
4 | Sponsored Products | Bidding Adjustment | 51810182230962 | Dynamic bids - down only | placementTop | 0.0 | 116 | 8 | 6.9% | 4.1 | 0.0 | 0 | 0 | 0.0 | 0.0% | 0.51 | 0.0 | Campaign Name - Dummy | enabled | |||||||||||||||||||||||||||||||
5 | Sponsored Products | Ad Group | 51810182230962 | 103843358501771 | Ad Group Name - Dummy | enabled | 0.4 | 2739 | 10 | 0.37% | 5.0 | 0.0 | 0 | 0 | 0.0 | 0.0% | 0.5 | 0.0 | Campaign Name - Dummy | Ad Group Name - Dummy | enabled | enabled | ||||||||||||||||||||||||||||
6 | Sponsored Products | Product Ad | 51810182230962 | 103843358501771 | 187095918266508 | enabled | SKU Name - Dummy | 2739 | 10 | 0.37% | 5.0 | 0.0 | 0 | 0 | 0.0 | 0.0% | 0.5 | 0.0 | Campaign Name - Dummy | Ad Group Name - Dummy | enabled | enabled | ||||||||||||||||||||||||||||
7 | Sponsored Products | Keyword | 51810182230962 | 103843358501771 | 133091597391670 | enabled | 0.58 | Keyword - Dummy | broad | 0 | 0 | 0.0% | 0.0 | 0.0 | 0 | 0 | 0.0 | 0.0% | 0.0 | 0.0 | Campaign Name - Dummy | Ad Group Name - Dummy | enabled | enabled | 0.4 | |||||||||||||||||||||||||
8 | Sponsored Products | Keyword | 51810182230962 | 103843358501771 | 20484689160127 | enabled | 0.64 | Keyword - Dummy | broad | 2085 | 10 | 0.48% | 5.0 | 0.0 | 0 | 0 | 0.0 | 0.0% | 0.5 | 0.0 | Campaign Name - Dummy | Ad Group Name - Dummy | enabled | enabled | 0.4 | |||||||||||||||||||||||||
9 | Sponsored Products | Keyword | 51810182230962 | 103843358501771 | 147161619594891 | enabled | 0.58 | Keyword - Dummy | broad | 23 | 0 | 0.0% | 0.0 | 0.0 | 0 | 0 | 0.0 | 0.0% | 0.0 | 0.0 | Campaign Name - Dummy | Ad Group Name - Dummy | enabled | enabled | 0.4 | |||||||||||||||||||||||||
10 | Sponsored Products | Keyword | 51810182230962 | 103843358501771 | 117074780596747 | enabled | 0.62 | Keyword - Dummy | broad | 394 | 0 | 0.0% | 0.0 | 0.0 | 0 | 0 | 0.0 | 0.0% | 0.0 | 0.0 | Campaign Name - Dummy | Ad Group Name - Dummy | enabled | enabled | 0.4 | |||||||||||||||||||||||||
11 | Sponsored Products | Keyword | 51810182230962 | 103843358501771 | 198054310782002 | enabled | 0.64 | Keyword - Dummy | broad | 0 | 0 | 0.0% | 0.0 | 0.0 | 0 | 0 | 0.0 | 0.0% | 0.0 | 0.0 | Campaign Name - Dummy | Ad Group Name - Dummy | enabled | enabled | 0.4 | |||||||||||||||||||||||||
12 | Sponsored Products | Negative Product Targeting | 51810182230962 | 103843358501771 | 216796694767871 | enabled | 0.64 | Keyword - Dummy | broad | 231 | 0 | 0.0% | 0.0 | 0.0 | 0 | 0 | 0.0 | 0.0% | 0.0 | 0.0 | Campaign Name - Dummy | Ad Group Name - Dummy | enabled | enabled | 0.4 | |||||||||||||||||||||||||
13 | Sponsored Products | Product Targeting | 51810182230962 | 103843358501771 | 116800394856451 | enabled | 0.64 | Keyword - Dummy | broad | 6 | 0 | 0.0% | 0.0 | 0.0 | 0 | 0 | 0.0 | 0.0% | 0.0 | 0.0 | Campaign Name - Dummy | Ad Group Name - Dummy | enabled | enabled | 0.4 | |||||||||||||||||||||||||
14 | Sponsored Products | Campaign | 224654867824700 | Portfolio1 | Campaign Name - Dummy | 20220101 | MANUAL | enabled | 100.0 | Dynamic bids - down only | 48 | 0 | 0.0% | 0.0 | 0.0 | 0 | 0 | 0.0 | 0.0% | 0.0 | 0.0 | Campaign Name - Dummy | enabled | |||||||||||||||||||||||||||
15 | Sponsored Products | Bidding Adjustment | 224654867824700 | Dynamic bids - down only | placementProductPage | 0.0 | 39 | 0 | 0.0% | 0.0 | 0.0 | 0 | 0 | 0.0 | 0.0% | 0.0 | 0.0 | Campaign Name - Dummy | enabled | |||||||||||||||||||||||||||||||
16 | Sponsored Products | Bidding Adjustment | 224654867824700 | Dynamic bids - down only | placementTop | 0.0 | 0 | 0 | 0.0% | 0.0 | 0.0 | 0 | 0 | 0.0 | 0.0% | 0.0 | 0.0 | Campaign Name - Dummy | enabled | |||||||||||||||||||||||||||||||
17 | Sponsored Products | Ad Group | 224654867824700 | 186267109368336 | Ad Group Name - Dummy | enabled | 1.1 | 48 | 0 | 0.0% | 0.0 | 0.0 | 0 | 0 | 0.0 | 0.0% | 0.0 | 0.0 | Campaign Name - Dummy | Ad Group Name - Dummy | enabled | enabled | ||||||||||||||||||||||||||||
18 | Sponsored Products | Product Ad | 224654867824700 | 186267109368336 | 52184089599015 | enabled | SKU Name - Dummy | 48 | 0 | 0.0% | 0.0 | 0.0 | 0 | 0 | 0.0 | 0.0% | 0.0 | 0.0 | Campaign Name - Dummy | Ad Group Name - Dummy | enabled | enabled | ||||||||||||||||||||||||||||
19 | Sponsored Products | Keyword | 224654867824700 | 186267109368336 | 83911309498353 | enabled | 1.08 | Keyword - Dummy | exact | 0 | 0 | 0.0% | 0.0 | 0.0 | 0 | 0 | 0.0 | 0.0% | 0.0 | 0.0 | Campaign Name - Dummy | Ad Group Name - Dummy | enabled | enabled | 1.1 | |||||||||||||||||||||||||
20 | Sponsored Products | Keyword | 224654867824700 | 186267109368336 | 53354652434783 | enabled | 1.08 | Keyword - Dummy | exact | 0 | 0 | 0.0% | 0.0 | 0.0 | 0 | 0 | 0.0 | 0.0% | 0.0 | 0.0 | Campaign Name - Dummy | Ad Group Name - Dummy | enabled | enabled | 1.1 | |||||||||||||||||||||||||
21 | Sponsored Products | Keyword | 224654867824700 | 186267109368336 | 2712747284010 | enabled | 0.97 | Keyword - Dummy | exact | 34 | 0 | 0.0% | 0.0 | 0.0 | 0 | 0 | 0.0 | 0.0% | 0.0 | 0.0 | Campaign Name - Dummy | Ad Group Name - Dummy | enabled | enabled | 1.1 | |||||||||||||||||||||||||
22 | Sponsored Products | Keyword | 224654867824700 | 186267109368336 | 8880509831632 | enabled | 0.97 | Keyword - Dummy | exact | 2 | 0 | 0.0% | 0.0 | 0.0 | 0 | 0 | 0.0 | 0.0% | 0.0 | 0.0 | Campaign Name - Dummy | Ad Group Name - Dummy | enabled | enabled | 1.1 | |||||||||||||||||||||||||
23 | Sponsored Products | Keyword | 224654867824700 | 186267109368336 | 29871655919998 | enabled | 1.08 | Keyword - Dummy | exact | 1 | 0 | 0.0% | 0.0 | 0.0 | 0 | 0 | 0.0 | 0.0% | 0.0 | 0.0 | Campaign Name - Dummy | Ad Group Name - Dummy | enabled | enabled | 1.1 | |||||||||||||||||||||||||
24 | Sponsored Products | Keyword | 224654867824700 | 186267109368336 | 207922361834615 | enabled | 1.57 | Keyword - Dummy | exact | 10 | 0 | 0.0% | 0.0 | 0.0 | 0 | 0 | 0.0 | 0.0% | 0.0 | 0.0 | Campaign Name - Dummy | Ad Group Name - Dummy | enabled | enabled | 1.1 | |||||||||||||||||||||||||
25 | Sponsored Products | Keyword | 224654867824700 | 186267109368336 | 82552476516641 | enabled | 0.8 | Keyword - Dummy | exact | 0 | 0 | 0.0% | 0.0 | 0.0 | 0 | 0 | 0.0 | 0.0% | 0.0 | 0.0 | Campaign Name - Dummy | Ad Group Name - Dummy | enabled | enabled | 1.1 | |||||||||||||||||||||||||
26 | Sponsored Products | Keyword | 224654867824700 | 186267109368336 | 125041523559069 | enabled | 1.08 | Keyword - Dummy | exact | 0 | 0 | 0.0% | 0.0 | 0.0 | 0 | 0 | 0.0 | 0.0% | 0.0 | 0.0 | Campaign Name - Dummy | Ad Group Name - Dummy | enabled | enabled | 1.1 | |||||||||||||||||||||||||
27 | Sponsored Products | Keyword | 224654867824700 | 186267109368336 | 178224892278959 | enabled | 1.17 | Keyword - Dummy | exact | 0 | 0 | 0.0% | 0.0 | 0.0 | 0 | 0 | 0.0 | 0.0% | 0.0 | 0.0 | Campaign Name - Dummy | Ad Group Name - Dummy | enabled | enabled | 1.1 | |||||||||||||||||||||||||
28 | Sponsored Products | Keyword | 224654867824700 | 186267109368336 | 237702370532591 | enabled | 1.25 | Keyword - Dummy | exact | 1 | 0 | 0.0% | 0.0 | 0.0 | 0 | 0 | 0.0 | 0.0% | 0.0 | 0.0 | Campaign Name - Dummy | Ad Group Name - Dummy | enabled | enabled | 1.1 | |||||||||||||||||||||||||
29 | Sponsored Products | Campaign | 60228050322464 | Portfolio2 | Campaign Name - Dummy | 20211221 | MANUAL | enabled | 100.0 | Dynamic bids - down only | 1 | 0 | 0.0% | 0.0 | 0.0 | 0 | 0 | 0.0 | 0.0% | 0.0 | 0.0 | Campaign Name - Dummy | enabled | |||||||||||||||||||||||||||
30 | Sponsored Products | Bidding Adjustment | 60228050322464 | Dynamic bids - down only | placementProductPage | 0.0 | 1 | 0 | 0.0% | 0.0 | 0.0 | 0 | 0 | 0.0 | 0.0% | 0.0 | 0.0 | Campaign Name - Dummy | enabled | |||||||||||||||||||||||||||||||
31 | Sponsored Products | Bidding Adjustment | 60228050322464 | Dynamic bids - down only | placementTop | 0.0 | 0 | 0 | 0.0% | 0.0 | 0.0 | 0 | 0 | 0.0 | 0.0% | 0.0 | 0.0 | Campaign Name - Dummy | enabled | |||||||||||||||||||||||||||||||
32 | Sponsored Products | Ad Group | 60228050322464 | 225369445700841 | Ad Group Name - Dummy | enabled | 0.06 | 1 | 0 | 0.0% | 0.0 | 0.0 | 0 | 0 | 0.0 | 0.0% | 0.0 | 0.0 | Campaign Name - Dummy | Ad Group Name - Dummy | enabled | enabled | ||||||||||||||||||||||||||||
33 | Sponsored Products | Product Ad | 60228050322464 | 225369445700841 | 101252162650765 | enabled | SKU Name - Dummy | 1 | 0 | 0.0% | 0.0 | 0.0 | 0 | 0 | 0.0 | 0.0% | 0.0 | 0.0 | Campaign Name - Dummy | Ad Group Name - Dummy | enabled | enabled | ||||||||||||||||||||||||||||
34 | Sponsored Products | Keyword | 60228050322464 | 225369445700841 | 232179385161330 | enabled | 0.11 | Keyword - Dummy | phrase | 1 | 0 | 0.0% | 0.0 | 0.0 | 0 | 0 | 0.0 | 0.0% | 0.0 | 0.0 | Campaign Name - Dummy | Ad Group Name - Dummy | enabled | enabled | 0.06 | |||||||||||||||||||||||||
Sponsored Products Campaigns |