Hi!
If someone could help me create a VBA code for this, I would really appreciate it! I need to find data on sheet "Report" and copy it to sheet "Table 1".
"Table 1" is pre-formatted. In column A are the Panel Types. I need all P** (P01, P02... etc.) panels from "Report" to be copied to "Table 1" under row "Panel (P), then all B** (B01, B02... etc.) panels to be copied to "Table 1" under row "Braced (B)" and so on. I am only interested in the first 8 columns, so columns A-H. In "Table 1" new row need to be inserted of course.
I have manually copied panel P01 in place for an example.
The data in "Report" can change, the number of each type of panels (01, 02.. etc) can change, and sometimes a type of panel is zero so it is not in the list.
Can this be done? Thank you!
If someone could help me create a VBA code for this, I would really appreciate it! I need to find data on sheet "Report" and copy it to sheet "Table 1".
"Table 1" is pre-formatted. In column A are the Panel Types. I need all P** (P01, P02... etc.) panels from "Report" to be copied to "Table 1" under row "Panel (P), then all B** (B01, B02... etc.) panels to be copied to "Table 1" under row "Braced (B)" and so on. I am only interested in the first 8 columns, so columns A-H. In "Table 1" new row need to be inserted of course.
I have manually copied panel P01 in place for an example.
The data in "Report" can change, the number of each type of panels (01, 02.. etc) can change, and sometimes a type of panel is zero so it is not in the list.
Can this be done? Thank you!
Copy data test.xlsm | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
A | B | C | D | E | F | G | H | |||
1 | Panel Type | Qty. | Width | Height | Thickness | Area (m²) | Angle | Weight (kg) | ||
2 | ||||||||||
3 | ||||||||||
4 | Panel (P) | |||||||||
5 | P01 | 1 | 1200 | 2600 | 400 | 3.12 | 174.5 | |||
6 | SUBTOTAL | 1 | 3.12 | 174.5 | ||||||
7 | ||||||||||
8 | Braced (B) | |||||||||
9 | ||||||||||
10 | SUBTOTAL | 0 | 0.00 | 0.0 | ||||||
11 | ||||||||||
12 | Column (C) | |||||||||
13 | ||||||||||
14 | SUBTOTAL | 0 | 0.00 | 0.0 | ||||||
Table 1 |
Cell Formulas | ||
---|---|---|
Range | Formula | |
B6,H14,F14,B14,H10,F10,B10,H6,F6 | B6 | =SUM(B4:B5) |
Copy data test.xlsm | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
A | B | C | D | E | F | G | H | I | J | |||
1 | ItemCode | Quantity | Width | Height | Thickness | Billed Area in m2 | Deg | kg | X1 | X2 | ||
2 | 345 | |||||||||||
3 | B01 | 2 | 800 | 2700 | 400 | 4.32 | 5 | 259 | 0.760152 | 0.864 | ||
4 | B02 | 6 | 800 | 2600 | 400 | 12.48 | 5 | 751.8 | 0.730608 | 0.832 | ||
5 | B03 | 1 | 800 | 2300 | 400 | 1.84 | 5 | 112.4 | 0.641916 | 0.736 | ||
6 | B04 | 2 | 800 | 2190 | 400 | 3.504 | 5 | 215.6 | 0.609572 | 0.701 | ||
7 | B05 | 1 | 600 | 2100 | 400 | 1.26 | 5 | 81.9 | 0.424292 | 0.504 | ||
8 | B06 | 4 | 800 | 1910 | 400 | 6.112 | 5 | 368 | 0.526272 | 0.611 | ||
9 | C01 | 1 | 397 | 3000 | 400 | 1.191 | 91.6 | 0.38063 | 0.476 | |||
10 | C02 | 1 | 361 | 3000 | 400 | 1.083 | 86 | 0.339516 | 0.433 | |||
11 | C03 | 1 | 380 | 2600 | 400 | 0.988 | 77.8 | 0.311204 | 0.395 | |||
12 | C04 | 4 | 400 | 1775 | 400 | 2.84 | 221.6 | 0.226068 | 0.284 | |||
13 | P01 | 1 | 1200 | 2600 | 400 | 3.12 | 174.5 | 1.13882 | 1.248 | |||
14 | P02 | 1 | 969 | 2600 | 400 | 2.519 | 145.1 | 0.906834 | 1.008 | |||
15 | P03 | 1 | 940 | 2600 | 400 | 2.444 | 141.4 | 0.87784 | 0.978 | |||
16 | P04 | 1 | 920 | 2600 | 400 | 2.392 | 138.7 | 0.857536 | 0.957 | |||
17 | P05 | 2 | 800 | 2600 | 400 | 4.16 | 232.6 | 0.759212 | 0.832 | |||
18 | P06 | 1 | 720 | 2600 | 400 | 1.872 | 106.1 | 0.678988 | 0.749 | |||
19 | P07 | 1 | 700 | 2600 | 400 | 1.82 | 103.6 | 0.65868 | 0.728 | |||
20 | P08 | 1 | 529 | 2600 | 400 | 1.375 | 81.6 | 0.486614 | 0.55 | |||
21 | P09 | 2 | 800 | 2300 | 400 | 3.68 | 208.4 | 0.66834 | 0.736 | |||
22 | P10 | 1 | 450 | 2100 | 400 | 0.945 | 59 | 0.325904 | 0.378 | |||
23 | P11 | 1 | 642 | 1200 | 400 | 0.77 | 47.9 | 0.26846 | 0.308 | |||
24 | P12 | 1 | 619 | 1200 | 400 | 0.743 | 46.4 | 0.25817 | 0.297 | |||
25 | P13 | 1 | 990 | 900 | 400 | 0.891 | 56.4 | 0.309404 | 0.356 | |||
26 | P14 | 1 | 640 | 900 | 400 | 0.576 | 36.5 | 0.199472 | 0.23 | |||
Report |