match column with three columns into two sheets and replace based on the first part

Ali M

Active Member
Joined
Oct 10, 2021
Messages
287
Office Version
  1. 2019
  2. 2013
Platform
  1. Windows
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
missed.xlsm
ABCDE
1ITEMSSTRQTYPRICETOTAL
21VBA123 215.5*S12.5 BOTTOLE 1L PR123 NRIT2142335805
32SLFR-101 FOOD-12 PR1011 NRIT2K560300
43SLFR-100 FOOOD-1 RF100 NBGFR1025250
SH1
Cell Formulas
RangeFormula
E2:E4E2=C2*D2

SH2
missed.xlsm
ABCDEFGH
1DATESSTRTTRMMRNNRQTYPRICETOTAL
207/08/2021SLFR-100FOOD-1PR100NRIT11025250
308/08/2021SLFR-101FOOD-2PR101NRIT22030600
409/08/2021SLFR-102FOOD-3PR102NRIT32335805
510/08/2021SLFR-103FOOD-4PR103NRIT42530750
611/08/2021SLFR-104FOOD-5PR104NRIT52040800
712/08/2021BTFOOD-6PR105NRIT61045450
813/08/2021BRRFOOD-7PR106NRIT72045900
914/08/2021SLFR-107FF/100PR107NRIT81555825
1015/08/2021DDTRFF/100L44PR108NRIT9560300
11TOT.MONTH1483655680
1201/09/2021DM120**225l20 FSLUNCHPR121NRIT221020200
1302/09/2021SLFR-1212000-15 55T N125 FDOPR122NRIT23520100
1403/09/2021VBA12325.5*S12.5 BOTTOLE 1LPR123NRIT242025500
15TOT.MONTH3565800
SH2
Cell Formulas
RangeFormula
F11:H11F11=SUM(F2:F10)
H12:H14,H2:H10H2=F2*G2
F15:H15F15=SUM(F12:F14)

SH3 the expected result
missed.xlsm
ABCDE
1ITEMSSTRQTYPRICETOTAL
21VBA123 25.5*S12.5 BOTTOLE 1L PR123 NRIT242335805
32SLFR-101 FOOD-2 PR101 NRIT2560300
43SLFR-100 FOOD-1 PR100 NRIT11025250
5
SH3
Cell Formulas
RangeFormula
E2:E4E2=C2*D2

my data are about 1200rows into two sheets
thanks
 

Excel Facts

When they said...
When they said you are going to "Excel at life", they meant you "will be doing Excel your whole life".

Forum statistics

Threads
1,214,621
Messages
6,120,563
Members
448,972
Latest member
Shantanu2024

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top