Good afternoon, I have some codes which help me delete certain rows based on a blank cell, having a hard time getting it to go from this
To this:
I'm going to have spreadsheets with variable ranges. I'm trying to get my code to look at Range("A7") and since there is nothing corresponding to this account (If the line below it is empty), delete all the rows up to the next non-blank cell which in this case would be until Range("A10"). Since there is data below Range("A10"), leave most of it alone, but row 13 should be deleted as there is no nothing important on that row. And repeat until the end of the spreadsheet.
Unsure what condition I can use to make this work. Any tips?
Book1 | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
A | B | C | D | E | F | G | H | |||
1 | Date | |||||||||
2 | Time | |||||||||
3 | User | |||||||||
4 | Rights | |||||||||
5 | ||||||||||
6 | Number | City | Country | Description | Owed | Notes | ||||
7 | 0000012-000 | School | ||||||||
8 | Change | 0 | ||||||||
9 | ||||||||||
10 | 0000013-000 | Playground | ||||||||
11 | Central | LA | US | Park United | 100 | Busiest Location | ||||
12 | West | LA | US | Park West | 150 | 2nd Busiest | ||||
13 | Change | 250 | ||||||||
14 | ||||||||||
15 | 0000015-000 | Museum | ||||||||
16 | Change | 0 | ||||||||
17 | ||||||||||
18 | 0000017-000 | Concert | ||||||||
19 | Europe | Paris | France | Venue1 | 50 | 100% Capacity | ||||
20 | North America | NYC | USA | Venue2 | 100 | 95% Capacity | ||||
21 | South America | Santiago | Chile | Venue3 | 150 | 95% Capacity | ||||
22 | Africa | Lagos | Nigeria | Venue4 | 200 | 95% Capacity | ||||
23 | Asia | Tokyo | Japan | Venue5 | 250 | 95% Capacity | ||||
24 | Australia | Melbourne | Austrlia | Venue6 | 300 | 95% Capacity | ||||
25 | Antartica | N/A | N/A | Venue7 | 450 | 0% Capacity | ||||
26 | Change | 1500 | ||||||||
27 | ||||||||||
28 | ||||||||||
29 | ||||||||||
30 | ||||||||||
Sheet1 |
To this:
Book1 | |||||||||
---|---|---|---|---|---|---|---|---|---|
A | B | C | D | E | F | G | |||
1 | Date | ||||||||
2 | Time | ||||||||
3 | User | ||||||||
4 | Rights | ||||||||
5 | |||||||||
6 | Number | City | Country | Description | Owed | Notes | |||
7 | 0000013-000 | Playground | |||||||
8 | Central | LA | US | Park United | 100 | Busiest Location | |||
9 | West | LA | US | Park West | 150 | 2nd Busiest | |||
10 | 0000017-000 | Concert | |||||||
11 | Europe | Paris | France | Venue1 | 50 | 100% Capacity | |||
12 | North America | NYC | USA | Venue2 | 100 | 95% Capacity | |||
13 | South America | Santiago | Chile | Venue3 | 150 | 95% Capacity | |||
14 | Africa | Lagos | Nigeria | Venue4 | 200 | 95% Capacity | |||
15 | Asia | Tokyo | Japan | Venue5 | 250 | 95% Capacity | |||
16 | Australia | Melbourne | Austrlia | Venue6 | 300 | 95% Capacity | |||
17 | Antartica | N/A | N/A | Venue7 | 450 | 0% Capacity | |||
18 | |||||||||
19 | |||||||||
20 | |||||||||
21 | |||||||||
22 | |||||||||
23 | |||||||||
24 | |||||||||
25 | |||||||||
Sheet1 |
I'm going to have spreadsheets with variable ranges. I'm trying to get my code to look at Range("A7") and since there is nothing corresponding to this account (If the line below it is empty), delete all the rows up to the next non-blank cell which in this case would be until Range("A10"). Since there is data below Range("A10"), leave most of it alone, but row 13 should be deleted as there is no nothing important on that row. And repeat until the end of the spreadsheet.
Unsure what condition I can use to make this work. Any tips?