VBA to update a sheet based on data from multiple columns

ScarletHolmes

New Member
Joined
Apr 13, 2021
Messages
1
Office Version
  1. 365
Platform
  1. Windows
I have two sheets in my workbook pertaining to this question.
Sheet 1 - The full list of sellable products with their profit centers, classes, descriptions, ..., amount in currency. I won't be able to use xl2bb to copy a portion for you to see, so I've included a picture.
Sheet 2 - A subset of the items first sheet. This sheet has the prices that I want the first sheet to be updated to when I run the macro, but they're in different columns.

For all the skus in sheet 2's columns E, H, L, R, and V, I'd like the cells corresponding to that sku in sheet 1 to get the prices in sheet 2's columns F, J, N, T, X

I don't have much experience writing VBA code, but any help would be appreciated.

PASTE THIS TO DYNAMICS.xlsx
BCDEFGHJKLNOPQRTUVXYZ
1nameinfoDisplay DescBoxNum BOX PRICE std mat STD MAT std serv STD SERV Std Price frag mat FRG MAT frag serv FRG SERV Frg Price
204x04x04box10012$ 4.0020604$ 2.0030604$ 2.00$ 8.0020603$ 3.3030603$ 3.00$ 10.30
306x06x06box10001$ 4.3520007$ 2.2030007$ 2.00$ 8.5520008$ 3.3030008$ 3.00$ 10.65
406x06x48box10078$ 9.0020154$ 6.1030229$ 8.00$ 23.1020155$ 8.3030230$ 9.00$ 26.30
508x05x03boxFlat10133$ 3.9920682$ 1.7030682$ 2.00$ 7.6920681$ 2.2030681$ 3.00$ 9.19
608x08x08box10002$ 4.7520010$ 2.8030010$ 2.00$ 9.5520011$ 5.5030011$ 3.00$ 13.25
709x05x03boxCellphone Box10147$ 7.9920724$ 1.7030724$ 2.00$ 11.6920723$ 2.2030723$ 3.00$ 13.19
810x10x10box10004$ 5.8020016$ 4.0030016$ 2.00$ 11.8020017$ 7.2030017$ 3.00$ 16.00
912x09x03Tuck Top BoxFlat10058$ 4.9920175$ 1.7030175$ 2.00$ 8.6920176$ 2.2030176$ 3.00$ 10.19
1012x06x06box101222$ 5.8020868$ 4.0030865$ 2.00$ 11.8020867$ 7.2030864$ 3.00$ 16.00
1112x09x06box101235$ 5.8020904$ 4.0030901$ 2.00$ 11.8020903$ 7.2030900$ 3.00$ 16.00
1212x12x06box10060$ 5.8020181$ 4.0030181$ 2.00$ 11.8020182$ 7.2030182$ 3.00$ 16.00
1312x12x12box10005$ 5.8520019$ 4.0030019$ 2.00$ 11.8520020$ 8.8030020$ 3.00$ 17.65
1412x12x30box101211$ 14.8520835$ 7.7030832$ 8.00$ 30.5520834$ 17.6030831$ 9.00$ 41.45
1513x10x03boxFlat110699$ 4.99110702$ 1.70110706$ 2.00$ 8.69110701$ 3.30110705$ 3.00$ 11.29
Master_List
Cell Formulas
RangeFormula
E2:E15E2=INDEX(Clean_Slate!F$1:F$13222,SMALL(IF(CONCAT(B2," ",C2)=Clean_Slate!C$1:C$13222,ROW(Clean_Slate!C$1:C$13222)-ROW(Clean_Slate!C$1)+1),1))
H2:H15H2=INDEX(Clean_Slate!F$1:F$13222,SMALL(IF(CONCAT(B2," Std Pack Materials")=Clean_Slate!C$1:C$13222,ROW(Clean_Slate!C$1:C$13222)-ROW(Clean_Slate!C$1)+1),1))
L2:L15L2=INDEX(Clean_Slate!F$1:F$13222,SMALL(IF(CONCAT(B2," Std Pack Service")=Clean_Slate!C$1:C$13222,ROW(Clean_Slate!C$1:C$13222)-ROW(Clean_Slate!C$1)+1),1))
P2:P15P2=SUM(F2,J2,N2)
R2:R15R2=INDEX(Clean_Slate!F$1:F$13222,SMALL(IF(CONCAT(B2," Frg Pack Materials")=Clean_Slate!C$1:C$13222,ROW(Clean_Slate!C$1:C$13222)-ROW(Clean_Slate!C$1)+1),1))
V2:V15V2=INDEX(Clean_Slate!F$1:F$13222,SMALL(IF(CONCAT(B2," Frg Pack Service")=Clean_Slate!C$1:C$13222,ROW(Clean_Slate!C$1:C$13222)-ROW(Clean_Slate!C$1)+1),1))
Z2:Z15Z2=SUM(F2,T2,X2)
Cells with Conditional Formatting
CellConditionCell FormatStop If True
V:VExpression=$V1<>$W1textNO
R:RExpression=$R1<>$S1textNO
H:HExpression=$H1<>$I1textNO
L2:L1048576Expression=$L2<>$M2textNO
 

Attachments

  • image_2021-04-13_055701.png
    image_2021-04-13_055701.png
    42.8 KB · Views: 11

Excel Facts

Spell Check in Excel
Press F7 to start spell check in Excel. Be careful, by default, Excel does not check Capitalized Werds (whoops)

Forum statistics

Threads
1,214,806
Messages
6,121,667
Members
449,045
Latest member
Marcus05

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