PS_Richard
New Member
- Joined
- Nov 22, 2022
- Messages
- 13
- Office Version
- 365
- 2016
- Platform
- Windows
Hello all,
Apologies now that the subject is a bit vague as trying to type what I want as a summary isn't easy. I have an export that comes from a software package I am unable to edit the formatting so need to do this within Excel.
This is an example of the dataset I'm working with but numerous amount of data (over 7000 rows) but this will vary depending on when the report was run. So this is what I am after happening. If in Column I there is a negative amount then it needs to keep that and all the previous fields that have the same product code preceding it, if it shows as N/A it needs to remove those rows.
So based on that logic with the above example it would check down column I, when it spots in I13 that the is a negative amount it will know it needs to keep all the data within B2:I13. It will then move onto the next section and will see in cell I20 that it shows as N/A, it will then need to delete cell range B14:I20 and remove those rows to then proceed to the next where before the rows were removed it would see that the next value in I32 is a negative so would keep those rows.
I hope this makes sense, I'm guessing this will most likely be a VBA script rather than dumping the data in one sheet to have it in another. Any questions you need to find out more information then please let me know. Thanks in advance for any help that can be given.
Thanks, PS_Richard
Apologies now that the subject is a bit vague as trying to type what I want as a summary isn't easy. I have an export that comes from a software package I am unable to edit the formatting so need to do this within Excel.
Book1.xlsx | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
A | B | C | D | E | F | G | H | I | J | |||
1 | Product Code | Product Description | Cat | Sales Order | Due Date | Required | In Stock | Shortfall | ||||
2 | BOS-194 | Product Description A1 | 2 | Sales Order | Due Date | Required | In Stock | Shortfall | ||||
3 | BOS-194 | Product Description A1 - Variant 1 | 2 | 33228 | 30/11/2022 | 1 | ||||||
4 | BOS-194 | Product Description A1 - Variant 1 | 2 | 33480 | 09/01/2023 | 1 | ||||||
5 | BOS-194 | Product Description A1 - Variant 1 | 2 | 33481 | 09/01/2023 | 1 | ||||||
6 | BOS-194 | Product Description A1 - Variant 1 | 2 | 33482 | 09/01/2023 | 1 | ||||||
7 | BOS-194 | Product Description A1 - Variant 1 | 2 | 33483 | 09/01/2023 | 1 | ||||||
8 | BOS-194 | Product Description A1 - Variant 2 | 2 | 33836 | 30/11/2022 | 1 | ||||||
9 | BOS-194 | Product Description A1 - Variant 2 | 2 | 33841 | 28/11/2022 | 1 | ||||||
10 | BOS-194 | Product Description A1 - Variant 1 | 2 | 34262 | 05/12/2022 | 3 | ||||||
11 | BOS-194 | Product Description A1 - Variant 1 | 2 | 34331 | 01/12/2022 | 1 | ||||||
12 | BOS-194 | Product Description A1 - Variant 1 | 2 | 34481 | 10/11/2022 | 1 | ||||||
13 | BOS-194 | Product Description A1 | 2 | Totals | 12 | 0 | -12 | |||||
14 | CLM-027 | Product Description A2 | 1 | Sales Order | Due Date | Required | In Stock | Shortfall | ||||
15 | CLM-027 | Product Description A2 - Variant 1 | 1 | 34425 | 10/11/2022 | 3 | ||||||
16 | CLM-027 | Product Description A2 - Variant 2 | 1 | 34441 | 10/11/2022 | 62 | ||||||
17 | CLM-027 | Product Description A2 - Variant 3 | 1 | 34519 | 10/11/2022 | 1 | ||||||
18 | CLM-027 | Product Description A2 - Variant 4 | 1 | 34525 | 10/11/2022 | 39 | ||||||
19 | CLM-027 | Product Description A2 - Variant 5 | 1 | 34529 | 10/11/2022 | 10 | ||||||
20 | CLM-027 | Product Description A2 | 1 | Totals | 115 | 3073 | N/A | |||||
21 | KML-030 | Product Description A3 | 2 | Sales Order | Due Date | Required | In Stock | Shortfall | ||||
22 | KML-030 | Product Description A3 - Variant 1 | 2 | 33228 | 30/11/2022 | 1 | ||||||
23 | KML-030 | Product Description A3 - Variant 1 | 2 | 33480 | 09/01/2023 | 1 | ||||||
24 | KML-030 | Product Description A3 - Variant 1 | 2 | 33481 | 09/01/2023 | 1 | ||||||
25 | KML-030 | Product Description A3 - Variant 1 | 2 | 33482 | 09/01/2023 | 1 | ||||||
26 | KML-030 | Product Description A3 - Variant 1 | 2 | 33483 | 09/01/2023 | 1 | ||||||
27 | KML-030 | Product Description A3 - Variant 2 | 2 | 33836 | 30/11/2022 | 1 | ||||||
28 | KML-030 | Product Description A3 - Variant 2 | 2 | 33841 | 28/11/2022 | 1 | ||||||
29 | KML-030 | Product Description A3 - Variant 1 | 2 | 34262 | 05/12/2022 | 3 | ||||||
30 | KML-030 | Product Description A3 - Variant 1 | 2 | 34331 | 01/12/2022 | 1 | ||||||
31 | KML-030 | Product Description A3 - Variant 1 | 2 | 34481 | 10/11/2022 | 1 | ||||||
32 | KML-030 | Product Description A3 | 2 | Totals | 12 | 0 | -12 | |||||
Sheet1 |
This is an example of the dataset I'm working with but numerous amount of data (over 7000 rows) but this will vary depending on when the report was run. So this is what I am after happening. If in Column I there is a negative amount then it needs to keep that and all the previous fields that have the same product code preceding it, if it shows as N/A it needs to remove those rows.
So based on that logic with the above example it would check down column I, when it spots in I13 that the is a negative amount it will know it needs to keep all the data within B2:I13. It will then move onto the next section and will see in cell I20 that it shows as N/A, it will then need to delete cell range B14:I20 and remove those rows to then proceed to the next where before the rows were removed it would see that the next value in I32 is a negative so would keep those rows.
I hope this makes sense, I'm guessing this will most likely be a VBA script rather than dumping the data in one sheet to have it in another. Any questions you need to find out more information then please let me know. Thanks in advance for any help that can be given.
Thanks, PS_Richard