Hi Macro experts,
I have around 1000 files (all in similar format) stored in one folder. In each file, there is a table like below example - 1. The first row of the table can be any row between 3rd and 16th; the columns and sequence of the header are fixed, always from column A to I (headers are from "Piece name to "Y Dimension")
I want to run a macro, and it goes to all the file in the folder and retrieve data from the table based on column E ("Material"). And create a summary report in a new workbook like example - 2
The Summary records target file name in column A; followed by the unique material code from that file which starts with "L"; followed by the total quantity of each Material code (retrieve from column B in example - 1), and finally the total area of each Material code (retrieve from column B and C using sumproduct in example - 1).
Thank you so much for your help!!
Example - 1
<tbody>
</tbody>
Example - 2
<tbody>
</tbody>
I have around 1000 files (all in similar format) stored in one folder. In each file, there is a table like below example - 1. The first row of the table can be any row between 3rd and 16th; the columns and sequence of the header are fixed, always from column A to I (headers are from "Piece name to "Y Dimension")
I want to run a macro, and it goes to all the file in the folder and retrieve data from the table based on column E ("Material"). And create a summary report in a new workbook like example - 2
The Summary records target file name in column A; followed by the unique material code from that file which starts with "L"; followed by the total quantity of each Material code (retrieve from column B in example - 1), and finally the total area of each Material code (retrieve from column B and C using sumproduct in example - 1).
Thank you so much for your help!!
Example - 1
A | B | C | D | E | F | G | H | I | |
1 | Piece name | Quantity | Area | Perimeter | Material code | Piece description | X Dimension | Y Dimension | |
2 | Part1 | 1 | 0.2239 | 28.04 | F | Fabric | 8.27 | 4.22 | |
3 | Part2 | 1 | 0.8154 | 45.10 | F | Fabric | 10.94 | 10.84 | |
4 | Part3 | 1 | 0.8091 | 43.25 | F | Fabric | 10.94 | 10.84 | |
5 | Part4 | 2 | 0.0168 | 6.09 | L | leather | 1.14 | 2.17 | |
6 | Part5 | 1 | 0.2564 | 30.37 | L | leather | 10.98 | 3.32 | |
7 | Part6 | 1 | 0.0492 | 10.38 | L1 | leather - 1 | 2.77 | 2.38 | |
8 | Part7 | 1 | 0.2494 | 27.11 | L1 | leather - 1 | 5.75 | 7.27 | |
9 | Part8 | 1 | 0.4402 | 33.77 | L1 | leather - 1 | 5.75 | 10.84 | |
10 | Part9 | 1 | 0.0666 | 26.28 | L2 | leather - 2 | 11.42 | 0.79 | |
11 | Part10 | 4 | 0.0344 | 17.06 | L2 | leather - 2 | 7.37 | 0.75 | |
12 | Part11 | 2 | 0.0230 | 11.04 | L3 | leather - 3 | 4.72 | 1.10 | |
13 | Part12 | 2 | 0.3406 | 33.67 | T | Polyester | 9.00 | 7.91 | |
14 | Part13 | 1 | 0.0454 | 22.81 | XB | Filler | 8.77 | 1.99 | |
15 | Part14 | 2 | 0.0069 | 31.10 | XS | Filler | 9.93 | 2.65 |
<tbody>
</tbody>
Example - 2
File name | Material | Quantity | Total Area |
datasheet-1 | L | 3 | 0.2899 |
datasheet-1 | L1 | 3 | 0.7388 |
datasheet-1 | L2 | 5 | 0.2042 |
datasheet-1 | L3 | 2 | 0.0461 |
<tbody>
</tbody>