ngochien251088
New Member
- Joined
- Jun 27, 2018
- Messages
- 11
- Office Version
- 2019
- Platform
- Windows
Dear all,
I would like to ask your help related to VBA excel as my bellow explaination.
In sheet "Data C" is the lookup sheet.
In sheet " Input" at cell C1, this is the list I made from the sheet Data C, row 1: shipments.
I have to manually choose each shipment by each shipment and save it as a new file with the same name of shipment number.
For example: I choose " SCC 181" then save it as the file as SCCc181, and continue to choose SCC 169 then save the file as SCC 169
Because I have to choose 50 to 100 times to make the shipment documents.
Could you please help me with VBA which can solve my problem?
I am a newbie in learning VBA basic only so I hope anyone to do me a favor to write the code for this Excel file.
I am very grateful for any help!
I would like to ask your help related to VBA excel as my bellow explaination.
In sheet "Data C" is the lookup sheet.
In sheet " Input" at cell C1, this is the list I made from the sheet Data C, row 1: shipments.
I have to manually choose each shipment by each shipment and save it as a new file with the same name of shipment number.
For example: I choose " SCC 181" then save it as the file as SCCc181, and continue to choose SCC 169 then save the file as SCC 169
Because I have to choose 50 to 100 times to make the shipment documents.
Could you please help me with VBA which can solve my problem?
I am a newbie in learning VBA basic only so I hope anyone to do me a favor to write the code for this Excel file.
I am very grateful for any help!
11 Shipment Document - Input sample file - 2024.xlsx | |||||
---|---|---|---|---|---|
A | B | C | |||
1 | Shipemnt | SCC 181 | |||
2 | |||||
3 | SCC-839 | ||||
4 | ORDER # | 11416158 | |||
5 | Order Date | 06/06/2024 | |||
6 | |||||
7 | LAST SHIP DATE | 12/08/2024 | |||
8 | BOOKED ETD | ||||
9 | NAK TENDER Date (Suggested) | 04/08/2024 | |||
10 | STAPLES ITEM # | ||||
11 | ST18053 | 0.00 | |||
12 | ST18054 | 0.00 | |||
13 | 1 | ST18055 | 377.00 | ||
14 | 2 | ST18056 | 150.00 | ||
15 | 3 | ST18057 | 1220.00 | ||
16 | ST18058 | 0.00 | |||
17 | 4 | ST18059 | 120.00 | ||
18 | ST18060 | 0.00 | |||
19 | ST18061 | 0.00 | |||
20 | 5 | ST18062 | 140.00 | ||
21 | 6 | ST18063 | 1040.00 | ||
22 | ST18064 | 0.00 | |||
23 | ST18065 | 0.00 | |||
24 | ST18066 | 0.00 | |||
25 | 7 | ST18067 | 195.00 | ||
26 | 8 | ST18074 | 150.00 | ||
27 | ST18080 | 0.00 | |||
28 | ST18081 | 0.00 | |||
29 | ST18086 | 0.00 | |||
30 | ST18087 | 0.00 | |||
31 | ST18088 | 0.00 | |||
32 | TOTAL PACKS | 3392.00 | |||
33 | TOTAL KGS | 8706.44 | |||
34 | (Max=19,958kg) | ||||
35 | 1 | INVOICE NO. | NV24-US-SBI-SCC 064 | ||
36 | 2 | VESSEL OR | GEORG MAERSK 412N | ||
37 | 3 | ON OR ABOUT | 22-Mar-24 | ||
38 | 4 | FROM | HO CHI MINH (ETD: 22-Mar-24) | ||
39 | 5 | TO | 91748_DECONSOL (ETA 10-May-24) | ||
40 | 6 | INVOICE date | 15-Mar-24 | ||
41 | 7 | PO NO | T240105 | ||
42 | 8 | POD | LOS ANGELES | ||
43 | 9 | PO DATE | 27-Feb-24 | ||
Input |
Cell Formulas | ||
---|---|---|
Range | Formula | |
C11:C33,C9,C7,C3:C5 | C3 | =+INDEX(DataC!$B$3:$Q$33,ROW(Input!B3)-2,MATCH(Input!$C$1,DataC!$B$1:$Q$1,0)) |
A11 | A11 | =IF(C11>0,1,"") |
A12:A31 | A12 | =IF(C12>0,MAX($A$11:A11)+1,"") |
C38 | C38 | ="HO CHI MINH (ETD: "&TEXT(C37,"dd-mmm-yy")&")" |
Cells with Data Validation | ||
---|---|---|
Cell | Allow | Criteria |
C1:C2 | List | =OFFSET(DataC!$B$1,0,0,1,COUNTA(DataC!$1:$1)-1) |
11 Shipment Document - Input sample file - 2024.xlsx | |||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
A | B | C | D | E | F | G | H | I | J | K | L | M | N | O | P | Q | |||
1 | Shipement No | SCC 169 | SCC 170 | SCC 171 | SCC 172 | SCC 173 | SCC 174 | SCC 175 | SCC 176 | SCC 177 | SCC 178 | SCC 179 | SCC 180 | SCC 181 | SCC 182 | SCC 183 | SCC 184 | ||
2 | |||||||||||||||||||
3 | SCC-472 | SCC-580 | SCC-675 | SCC-683 | SCC-684 | SCC-688 | SCC-692 | SCC-716 | SCC-748 | SCC-805 | SCC-807 | SCC-834 | SCC-839 | SCC-895 | SCC-925 | SCC-937 | |||
4 | ORDER # | 11416146 | 11416147 | 11416148 | 11416149 | 11416150 | 11416151 | 11416152 | 11416153 | 11416154 | 11416155 | 11416156 | 11416157 | 11416158 | 11416159 | 11416160 | 11416161 | ||
5 | Order Date | 06/06/2024 | ######## | ######## | ######## | ######## | ######## | ######## | ######## | ######## | ######## | ######## | ######## | ######## | ######## | ######## | ######## | ||
6 | |||||||||||||||||||
7 | LAST SHIP DATE | 12/08/2024 | ######## | ######## | ######## | ######## | ######## | ######## | ######## | ######## | ######## | ######## | ######## | ######## | ######## | ######## | ######## | ||
8 | BOOKED ETD | ||||||||||||||||||
9 | NAK TENDER Date (Suggested) | 04/08/2024 | ##### | ##### | ##### | ##### | ##### | ##### | ##### | ##### | ##### | ##### | ##### | ##### | ##### | ##### | ##### | ||
10 | STAPLES ITEM # | ||||||||||||||||||
11 | ST18053 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | ||
12 | ST18054 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | ||
13 | ST18055 | 37 | 0 | 179 | 208 | 169 | 0 | 47 | 0 | 33 | 114 | 34 | 34 | 377 | 178 | 44 | 51 | ||
14 | ST18056 | 20 | 110 | 70 | 90 | 0 | 0 | 10 | 40 | 50 | 50 | 40 | 0 | 150 | 20 | 0 | 180 | ||
15 | ST18057 | 1170 | 0 | 840 | 0 | 640 | 100 | 0 | 0 | 730 | 990 | 260 | 330 | 1220 | 1470 | 0 | 440 | ||
16 | ST18058 | 320 | 50 | 20 | 1060 | 160 | 0 | 0 | 30 | 60 | 0 | 80 | 20 | 0 | 620 | 20 | 0 | ||
17 | ST18059 | 0 | 0 | 30 | 30 | 0 | 0 | 0 | 10 | 0 | 20 | 0 | 0 | 120 | 50 | 0 | 20 | ||
18 | ST18060 | 150 | 30 | 0 | 0 | 0 | 10 | 0 | 0 | 0 | 0 | 0 | 100 | 0 | 220 | 0 | 270 | ||
19 | ST18061 | 80 | 0 | 150 | 0 | 210 | 0 | 40 | 150 | 10 | 0 | 10 | 260 | 0 | 0 | 10 | 0 | ||
20 | ST18062 | 500 | 170 | 200 | 150 | 40 | 60 | 0 | 0 | 210 | 10 | 0 | 50 | 140 | 160 | 0 | 0 | ||
21 | ST18063 | 0 | 880 | 25 | 745 | 990 | 55 | 475 | 455 | 565 | 585 | 125 | 490 | 1040 | 830 | 145 | 4820 | ||
22 | ST18064 | 315 | 55 | 20 | 980 | 70 | 0 | 0 | 20 | 5 | 0 | 0 | 10 | 0 | 0 | 40 | 30 | ||
23 | ST18065 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | ||
24 | ST18066 | 60 | 0 | 0 | 85 | 0 | 45 | 0 | 25 | 0 | 20 | 25 | 0 | 0 | 0 | 50 | 65 | ||
25 | ST18067 | 270 | 95 | 95 | 0 | 40 | 0 | 0 | 70 | 55 | 30 | 20 | 70 | 195 | 45 | 0 | 170 | ||
26 | ST18074 | 50 | 210 | 30 | 30 | 220 | 30 | 40 | 80 | 50 | 10 | 0 | 20 | 150 | 10 | 10 | 80 | ||
27 | ST18080 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | ||
28 | ST18081 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | ||
29 | ST18086 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | ||
30 | ST18087 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | ||
31 | ST18088 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | ||
32 | TOTAL PACKS | 2972 | 1600 | 1659 | 3378 | 2539 | 300 | 612 | 880 | 1768 | 1829 | 594 | 1384 | 3392 | 3603 | 319 | 6126 | ||
33 | TOTAL KGS | 4592.707 | 3278.848 | 3556.269 | 8101.45 | 5826.923 | 483.934 | 1755.801 | 1809.62 | 3154.759 | 3900.724 | 1191.534 | 2658.404 | 8706.439 | 6765.968 | 1061.654 | 14565.95 | ||
34 | (Max=19,958kg) | ||||||||||||||||||
35 | INVOICE NO. | ||||||||||||||||||
36 | VESSEL OR | ||||||||||||||||||
37 | ON OR ABOUT | ||||||||||||||||||
38 | FROM | ||||||||||||||||||
39 | TO | ||||||||||||||||||
40 | INVOICE date | ||||||||||||||||||
41 | PO NO | ||||||||||||||||||
42 | POD | ||||||||||||||||||
43 | PO DATE | ||||||||||||||||||
DataC |