Hello,
in QW sheet will be multiple columns contain prices and every time I will add new column contain new prices .
in STOCK sheet contains data in columns A:E
what I want create report in columns G:L with formatting and borders by brings the prices from last column in QW sheet and put in column J , as to column K=column I* column J
column L =column K- column E
in lastrow for column G when amount is minus in column L then populate LOSE word ,amount is plus in column L then populate PROFIT word.
if there is empty cell in last column in QW when brings price from previous column(not the first column) for instance if there is price in columnL,M,N and if the id doesn't existed price in column N then will brings from column M .
when create report will match BATCH column for two sheets , also if there is ID in STOCK sheet and it's not existed in QW sheet then will show as in STOCK sheet.
result
I need macro , I don't PQ or PT , formulas
thanks
in QW sheet will be multiple columns contain prices and every time I will add new column contain new prices .
in STOCK sheet contains data in columns A:E
what I want create report in columns G:L with formatting and borders by brings the prices from last column in QW sheet and put in column J , as to column K=column I* column J
column L =column K- column E
in lastrow for column G when amount is minus in column L then populate LOSE word ,amount is plus in column L then populate PROFIT word.
if there is empty cell in last column in QW when brings price from previous column(not the first column) for instance if there is price in columnL,M,N and if the id doesn't existed price in column N then will brings from column M .
when create report will match BATCH column for two sheets , also if there is ID in STOCK sheet and it's not existed in QW sheet then will show as in STOCK sheet.
subtra.xlsm | ||||||
---|---|---|---|---|---|---|
J | K | L | M | |||
1 | ITEM | BATCH | 01/11/2024 | 02/11/2024 | ||
2 | 1 | APP PP FRUIT | 12.00 | 11.00 | ||
3 | 2 | BAN FF FRUIT | 9.00 | |||
4 | 3 | CU CMC VEG | 11.00 | 11.00 | ||
5 | 4 | FRU BANN MU | 22.00 | 23.00 | ||
6 | 5 | PI PIA FRUIT | 21.00 | 21.00 | ||
7 | 6 | PO PTT VEG | 12.00 | 11.00 | ||
8 | 7 | TO TMA VEG | 5.00 | 4.00 | ||
9 | 8 | TE TEE FOOD | 23.00 | 18.00 | ||
10 | 9 | TRB POT BNG | 22.00 | 24.00 | ||
QW |
subtra.xlsm | |||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
A | B | C | D | E | F | G | H | I | J | K | L | M | N | O | |||
1 | ITEM | BATCH | QTY | UNIT PRICE | TOTAL | ||||||||||||
2 | 1 | TO TMA VEG | 10.00 | 5.00 | 50.00 | ||||||||||||
3 | 2 | PO PTT VEG | 20.00 | 10.00 | 200.00 | ||||||||||||
4 | 3 | BAN FF FRUIT | 100.00 | 12.00 | 1,200.00 | ||||||||||||
5 | 4 | APP PP FRUIT | 100.00 | 10.00 | 1,000.00 | ||||||||||||
6 | 5 | PI PIA FRUIT | 12.00 | 22.00 | 264.00 | ||||||||||||
7 | 6 | TE TEE FOOD | 100.00 | 23.00 | 2,300.00 | ||||||||||||
8 | 7 | CU CMC VEG | 120.00 | 21.00 | 2,520.00 | ||||||||||||
9 | 8 | TRB POT BNG | 100.00 | 22.00 | 2,200.00 | ||||||||||||
10 | 9 | FRU BANN MU | 124.00 | 22.00 | 2,728.00 | ||||||||||||
11 | |||||||||||||||||
12 | |||||||||||||||||
13 | |||||||||||||||||
14 | |||||||||||||||||
STOCK |
result
subtra.xlsm | |||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
A | B | C | D | E | F | G | H | I | J | K | L | M | N | O | |||
1 | ITEM | BATCH | QTY | UNIT PRICE | TOTAL | ITEM | BATCH | QTY | UNIT PRICE | TOTAL | D/P | ||||||
2 | 1 | TO TMA VEG | 10.00 | 5.00 | 50.00 | 1 | TO TMA VEG | 10.00 | 4.00 | 40.00 | -10.00 | ||||||
3 | 2 | PO PTT VEG | 20.00 | 10.00 | 200.00 | 2 | PO PTT VEG | 20.00 | 11.00 | 220.00 | 20.00 | ||||||
4 | 3 | BAN FF FRUIT | 100.00 | 12.00 | 1,200.00 | 3 | BAN FF FRUIT | 100.00 | 9.00 | 900.00 | -300.00 | ||||||
5 | 4 | APP PP FRUIT | 100.00 | 10.00 | 1,000.00 | 4 | APP PP FRUIT | 100.00 | 11.00 | 1,100.00 | 100.00 | ||||||
6 | 5 | PI PIA FRUIT | 12.00 | 22.00 | 264.00 | 5 | PI PIA FRUIT | 12.00 | 21.00 | 252.00 | -12.00 | ||||||
7 | 6 | TE TEE FOOD | 100.00 | 23.00 | 2,300.00 | 6 | TE TEE FOOD | 100.00 | 18.00 | 1,800.00 | -500.00 | ||||||
8 | 7 | CU CMC VEG | 120.00 | 21.00 | 2,520.00 | 7 | CU CMC VEG | 120.00 | 11.00 | 1,320.00 | -1,200.00 | ||||||
9 | 8 | TRB POT BNG | 100.00 | 22.00 | 2,200.00 | 8 | TRB POT BNG | 100.00 | 24.00 | 2,400.00 | 200.00 | ||||||
10 | 9 | FRU BANN MU | 124.00 | 22.00 | 2,728.00 | 9 | FRU BANN MU | 124.00 | 23.00 | 2,852.00 | 124.00 | ||||||
11 | LOSE | -1,578.00 | |||||||||||||||
12 | |||||||||||||||||
13 | |||||||||||||||||
STOCK |
Cell Formulas | ||
---|---|---|
Range | Formula | |
L2:L10 | L2 | =K2-E2 |
L11 | L11 | =SUM(L2:L10) |
I need macro , I don't PQ or PT , formulas
thanks