Hi
I want to add headers for each separate range and for each element, starting from the first row and ending with the last row for the same element, provided that the entire range is duplicated for the same element based on column A, and the headers must be the same as in the first row for all ranges, as in the second range, the headers are different For the headers of the first row of the first range, then the headers of the first row of the first range must be replaced with the headers of the second .as to third range should insert new row before the first row with a new element and after the last row of the element that precedes it, and the headings are the same as the headers of the first row for the first range
will be add new ranges , so the macro must be applied several times each time new ranges are added without affecting what was previously executed on some of the ranges that already existed.
before
after
I want to add headers for each separate range and for each element, starting from the first row and ending with the last row for the same element, provided that the entire range is duplicated for the same element based on column A, and the headers must be the same as in the first row for all ranges, as in the second range, the headers are different For the headers of the first row of the first range, then the headers of the first row of the first range must be replaced with the headers of the second .as to third range should insert new row before the first row with a new element and after the last row of the element that precedes it, and the headings are the same as the headers of the first row for the first range
will be add new ranges , so the macro must be applied several times each time new ranges are added without affecting what was previously executed on some of the ranges that already existed.
before
items v .xlsm | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
A | B | C | D | E | F | G | H | |||
1 | CLASSIFICATION | GOODS | MARK | MANFACTURE | BUYING | SELLING | NET | NOTE | ||
2 | OIL-AS2 | MLO-1 10W40 208L TT/L | CAS | SU | 23 | |||||
3 | OIL-AS2 | 10W40 208L | ENI | IT | 12 | 11 | ||||
4 | OIL-AS2 | 5W30 208L | Q8 | EU | ||||||
5 | OIL-AS2 | 10W40 208L | Q8 | EU | 11 | |||||
6 | ITEM | BRAND | SQ | PRTD4 | ENTER | OUT | TOTAL | DEL.SS | ||
7 | OIL-AS3 | 10W40 12x1L | Q8 | EU | 111 | |||||
8 | OIL-AS3 | 10W40 12x1L | CAS | SU | 111 | |||||
9 | OIL-AS3 | 10W40 12x1L | ENI | IT | 112 | |||||
10 | OIL-AS3 | OL-115W40 12x1L | CAS | SU**2 | 22 | |||||
11 | MS-OIL1 | 5W30 12x1L | Q8 | EU | 11 | |||||
12 | MS-OIL1 | 10W40 4x4L | Q8 | EU | 111 | 11 | ||||
13 | MS-OIL1 | OIL/M 10W40 4x4L | CAS TRM | SU N3-90 | 33 | |||||
14 | MS-OIL1 | 10W40 4x4L MNH/80-T | ENI | IT L66RT | 44 | |||||
15 | MS-OIL1 | 5W40 4x4L | Q8 | EU | 555 | |||||
16 | MS-OIL1 | 5W40 4x4L | CAS | SU | 555 | |||||
17 | MS-OIL1 | 5W40 4x4L | ENI | IT | 555 | |||||
18 | MS-OIL1 | 20W50 4x4L | Q8 | EU | 222 | |||||
19 | MS-OIL1 | 20W50 4x4L | CAS | SU | 222 | |||||
20 | MS-OIL1 | 20W50 4x4L | ENI | IT | 222 | |||||
21 | MS-OIL1 | 5W30 4x4L | Q8 | EU | 555 | |||||
5 |
after
items v .xlsm | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
A | B | C | D | E | F | G | H | |||
1 | CLASSIFICATION | GOODS | MARK | MANFACTURE | BUYING | SELLING | NET | NOTE | ||
2 | OIL-AS2 | MLO-1 10W40 208L TT/L | CAS | SU | 23 | |||||
3 | OIL-AS2 | 10W40 208L | ENI | IT | 12 | 11 | ||||
4 | OIL-AS2 | 5W30 208L | Q8 | EU | ||||||
5 | OIL-AS2 | 10W40 208L | Q8 | EU | 11 | |||||
6 | CLASSIFICATION | GOODS | MARK | MANFACTURE | BUYING | SELLING | NET | NOTE | ||
7 | OIL-AS3 | 10W40 12x1L | Q8 | EU | 111 | |||||
8 | OIL-AS3 | 10W40 12x1L | CAS | SU | 111 | |||||
9 | OIL-AS3 | 10W40 12x1L | ENI | IT | 112 | |||||
10 | OIL-AS3 | OL-115W40 12x1L | CAS | SU**2 | 22 | |||||
11 | CLASSIFICATION | GOODS | MARK | MANFACTURE | BUYING | SELLING | NET | NOTE | ||
12 | MS-OIL1 | 5W30 12x1L | Q8 | EU | 11 | |||||
13 | MS-OIL1 | 10W40 4x4L | Q8 | EU | 111 | 11 | ||||
14 | MS-OIL1 | OIL/M 10W40 4x4L | CAS TRM | SU N3-90 | 33 | |||||
15 | MS-OIL1 | 10W40 4x4L MNH/80-T | ENI | IT L66RT | 44 | |||||
16 | MS-OIL1 | 5W40 4x4L | Q8 | EU | 555 | |||||
17 | MS-OIL1 | 5W40 4x4L | CAS | SU | 555 | |||||
18 | MS-OIL1 | 5W40 4x4L | ENI | IT | 555 | |||||
19 | MS-OIL1 | 20W50 4x4L | Q8 | EU | 222 | |||||
20 | MS-OIL1 | 20W50 4x4L | CAS | SU | 222 | |||||
21 | MS-OIL1 | 20W50 4x4L | ENI | IT | 222 | |||||
22 | MS-OIL1 | 5W30 4x4L | Q8 | EU | 555 | |||||
5 |