hello
I need macro to replace data in sh3 . it should match column B,C,D in sh2 with column B in sh1 based on first part . if the sh1 is not matched with column B into SH2 then should replace data based on sh2 into sh1 in column B . the first part depends on column B into SH2 should match with first part is existed in SH1 for instance (SLFR-101,SLFR-100,VBA123)
as shows into two sheets SH1,2
SH1
SH2
SH3 the expected result
my data are about 1200rows into two sheets
thanks
I need macro to replace data in sh3 . it should match column B,C,D in sh2 with column B in sh1 based on first part . if the sh1 is not matched with column B into SH2 then should replace data based on sh2 into sh1 in column B . the first part depends on column B into SH2 should match with first part is existed in SH1 for instance (SLFR-101,SLFR-100,VBA123)
as shows into two sheets SH1,2
SH1
missed.xlsm | |||||||
---|---|---|---|---|---|---|---|
A | B | C | D | E | |||
1 | ITEM | SSTR | QTY | PRICE | TOTAL | ||
2 | 1 | VBA123 215.5*S12.5 BOTTOLE 1L PR123 NRIT214 | 23 | 35 | 805 | ||
3 | 2 | SLFR-101 FOOD-12 PR1011 NRIT2K | 5 | 60 | 300 | ||
4 | 3 | SLFR-100 FOOOD-1 RF100 NBGFR | 10 | 25 | 250 | ||
SH1 |
Cell Formulas | ||
---|---|---|
Range | Formula | |
E2:E4 | E2 | =C2*D2 |
SH2
missed.xlsm | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
A | B | C | D | E | F | G | H | |||
1 | DATE | SSTR | TTR | MMR | NNR | QTY | PRICE | TOTAL | ||
2 | 07/08/2021 | SLFR-100 | FOOD-1 | PR100 | NRIT1 | 10 | 25 | 250 | ||
3 | 08/08/2021 | SLFR-101 | FOOD-2 | PR101 | NRIT2 | 20 | 30 | 600 | ||
4 | 09/08/2021 | SLFR-102 | FOOD-3 | PR102 | NRIT3 | 23 | 35 | 805 | ||
5 | 10/08/2021 | SLFR-103 | FOOD-4 | PR103 | NRIT4 | 25 | 30 | 750 | ||
6 | 11/08/2021 | SLFR-104 | FOOD-5 | PR104 | NRIT5 | 20 | 40 | 800 | ||
7 | 12/08/2021 | BT | FOOD-6 | PR105 | NRIT6 | 10 | 45 | 450 | ||
8 | 13/08/2021 | BRR | FOOD-7 | PR106 | NRIT7 | 20 | 45 | 900 | ||
9 | 14/08/2021 | SLFR-107 | FF/100 | PR107 | NRIT8 | 15 | 55 | 825 | ||
10 | 15/08/2021 | DDTR | FF/100L44 | PR108 | NRIT9 | 5 | 60 | 300 | ||
11 | TOT.MONTH | 148 | 365 | 5680 | ||||||
12 | 01/09/2021 | DM | 120**225l20 FSLUNCH | PR121 | NRIT22 | 10 | 20 | 200 | ||
13 | 02/09/2021 | SLFR-121 | 2000-15 55T N125 FDO | PR122 | NRIT23 | 5 | 20 | 100 | ||
14 | 03/09/2021 | VBA123 | 25.5*S12.5 BOTTOLE 1L | PR123 | NRIT24 | 20 | 25 | 500 | ||
15 | TOT.MONTH | 35 | 65 | 800 | ||||||
SH2 |
Cell Formulas | ||
---|---|---|
Range | Formula | |
F11:H11 | F11 | =SUM(F2:F10) |
H12:H14,H2:H10 | H2 | =F2*G2 |
F15:H15 | F15 | =SUM(F12:F14) |
SH3 the expected result
missed.xlsm | |||||||
---|---|---|---|---|---|---|---|
A | B | C | D | E | |||
1 | ITEM | SSTR | QTY | PRICE | TOTAL | ||
2 | 1 | VBA123 25.5*S12.5 BOTTOLE 1L PR123 NRIT24 | 23 | 35 | 805 | ||
3 | 2 | SLFR-101 FOOD-2 PR101 NRIT2 | 5 | 60 | 300 | ||
4 | 3 | SLFR-100 FOOD-1 PR100 NRIT1 | 10 | 25 | 250 | ||
5 | |||||||
SH3 |
Cell Formulas | ||
---|---|---|
Range | Formula | |
E2:E4 | E2 | =C2*D2 |
my data are about 1200rows into two sheets
thanks