complicated project to add new data before specific row for each part

Mussa

Active Member
Joined
Jul 12, 2021
Messages
264
Office Version
  1. 2019
  2. 2010
hello

I need help from experts. this project is very complicated . so what I want match column C for sheets (rop,sol,sall,slm) with columns B,C,D together if they are matched then should pull the values and summing when there are repeated items into sheets (rop,sol,sall,slm) but when pull or summing data should be based on heades for two columns (BTR,SALR) becuase I will insert three columns every month (BTR,SALR,QTY) ,and if there is new item is exised in sheets(rop,sol,sall,slm) but not existed in sheet DATA , then should add before TOTAL row for each part . how know which is part should add it ? . it depends on match column B for sheets(rop,sol,sall,slm) with column A in sheet DATA . the item for every part in column A starts from row 1 and finish up to TOTAL row when matching . but if the items counts are different for the others have already divided in sheet DATA .as you see most of items are divided contains 4 items in sheet DATA and also in sheets((rop,sol,sall,slm) into column C .,so in this case split firs two item in column B, and second item in column C and third item in column D , but somtimes contains five or six items then when split for sheet DATA column B = first two items , column C = second two items , column D = last one item . as to six items then when split in sheet DATA column B = first two items , column C = second two items , column D = last two items

see the rows 3,4 (rop,sol) and compare with divied in sheet data in row14,19

if what I ask for it is impossible or any idea can be easy or better than what I ask it , all of my ears.
if this is not clear just infor me
thanks

before
ITEM (2).xlsm
ABCDEFGHIJKLMNOPQRS
2DEL NOBATCH NO TTLTT1BTRSALRQTYBTRSALRQTYBTRSALRQTYBTRSALRQTYBTRSALRQTY
3CCBT CC-1SS-1TRU00000
4BT CC-1SS-1LTR00000
5BT CC-2SS-2FG00000
6TOTAL000000000000000
7CCNCT CC-1SS-1TRR00000
8CT CC-1SS-1LTR00000
9TOTAL000000000000000
10CDDD CS-1LL-1RRL00000
11DD CS-2LL-2TTY00000
12DD CS-3LL-3MMW00000
13DD CS-4LL-4NNW00000
14TOTAL000000000000000
15CCLLC CC-2SS-2LTR00000
16TOTAL000000000000000
17CCMLM CC-3SS-3LTR00000
18TOTAL000000000000000
data
Cell Formulas
RangeFormula
E6:S6E6=SUM(E3:E5)
E9:S9E9=SUM(E7:E8)
E14:S14E14=SUM(E10:E13)
E18:S18,E16:S16E16=SUM(E15:E15)
S17,S15,S10:S13,S7:S8,S3:S5,P17,P15,P10:P13,P7:P8,P3:P5,M17,M15,M10:M13,M7:M8,M3:M5,J17,J15,J10:J13,J7:J8,J3:J5,G17,G15,G10:G13,G7:G8,G3:G5G3=E3-F3



ITEM (2).xlsm
ABCD
1ITEMDEL NOBATCH NO BTR
21CCMLM CC-3 SS-3 LTR110
32CCMLM CC-4 MM SS-3 LTR111
43CCBT CC-1 SS-1 TRU200
54CCBT CC-1 SS-1 LTR120
65CCBT CC-2 SS-2 FG110
76CCNCT CC-1 SS-1 TRR100
87CCNCT CC-1 SS-1 LTR110
98CDDD CS-1 LL-1 RRL200
109CDDD CS-2 LL-2 TTY220
1110CDDD CS-3 LL-3 MMW200
1211CDDD CS-4 LL-4 NNW100
1312CCLLC CC-2 SS-2 LTR110
rop



ITEM (2).xlsm
ABCD
1ITEMDEL NOBATCH NO BTR
21CCBT CC-1 SS-1 TRU200
32CCBT CC-1 SS-1 LTR120
43CCNCT CC-1 SS-1 LTR110
54CDDD CS-2 PP2 LL-1 SS20 RRL200
65CCBT CC-2 SS-2 FG110
76CCNCT CC-1 SS-1 TRR100
sol



ITEM (2).xlsm
ABCD
1ITEMDEL NOBATCH NO SALR
21CCBT CC-1 SS-1 TRU200
32CCBT CC-1 SS-1 LTR120
43CCNCT CC-1 SS-1 LTR110
54CDDD CS-2 PP2 LL-1 SS20 RRL200
65CCBT CC-2 SS-2 FG110
76CCNCT CC-1 SS-1 TRR100
SALL



ITEM (2).xlsm
ABCDE
1ITEMDEL NOBATCH NO SALRBTR
21CCMLM CC-3 SS-3 LTR110200
32CCMLM CC-4 MM SS-3 LTR111120
43CCBT CC-1 SS-1 TRU200110
54CCBT CC-1 SS-1 LTR120200
65CCBT CC-2 SS-2 FG110110
SLM



after when run from the first time
ITEM (2).xlsm
ABCDEFGHIJKLMNOPQRS
2DEL NOBATCH NO TTLTT1BTRSALRQTYBTRSALRQTYBTRSALRQTYBTRSALRQTYBTRSALRQTY
3CCBT CC-1SS-1TRU5104001100000
4BT CC-1SS-1LTR4402402000000
5BT CC-2SS-2FG3302201100000
6TOTAL1280860420000000000000
7CCNCT CC-1SS-1TRR2001001000000
8CT CC-1SS-1LTR2201101100000
9TOTAL420210210000000000000
10CDDD CS-1LL-1RRL2002000000
11DD CS-2LL-2TTY2202200000
12DD CS-3LL-3MMW2002000000
13DD CS-4LL-4NNW1001000000
14DD CS-2PP2 LL-1SS20 RRL20020000000
15TOTAL920200720000000000000
16CCLLC CC-2SS-2LTR1101100000
17TOTAL1100110000000000000
18CCMLM CC-3SS-3LTR3101102000000
19LM CC-4MM SS-3LTR2311111200000
20TOTAL541221320000000000000
data
Cell Formulas
RangeFormula
E6:S6E6=SUM(E3:E5)
E20:S20,E9:S9E9=SUM(E7:E8)
E15:S15E15=SUM(E10:E14)
E17:S17E17=SUM(E16:E16)
S18:S19,S16,S10:S14,S7:S8,S3:S5,P18:P19,P16,P10:P14,P7:P8,P3:P5,M18:M19,M16,M10:M14,M7:M8,M3:M5,J18:J19,J16,J10:J14,J7:J8,J3:J5,G18:G19,G16,G10:G14,G7:G8,G3:G5G3=E3-F3

if run again should move empty columns BTR,SALR whether add new data before TOTAL row for each part or pull and summing values for data have already existed
ITEM (2).xlsm
ABCDEFGHIJKLMNOPQRS
2DEL NOBATCH NO TTLTT1BTRSALRQTYBTRSALRQTYBTRSALRQTYBTRSALRQTYBTRSALRQTY
3CCBT CC-1SS-1TRU510400110510400110000
4BT CC-1SS-1LTR440240200440240200000
5BT CC-2SS-2FG330220110330220110000
6TOTAL12808604201280860420000000000
7CCNCT CC-1SS-1TRR200100100200100100000
8CT CC-1SS-1LTR220110110220110110000
9TOTAL420210210420210210000000000
10CDDD CS-1LL-1RRL200200200200000
11DD CS-2LL-2TTY220220220220000
12DD CS-3LL-3MMW200200200200000
13DD CS-4LL-4NNW100100100100000
14DD CS-2PP2 LL-1SS20 RRL20020002002000000
15TOTAL920200720920200720000000000
16CCLLC CC-2SS-2LTR110110110110000
17TOTAL11001101100110000000000
18CCMLM CC-3SS-3LTR310110200310110200000
19LM CC-4MM SS-3LTR231111120231111120000
20TOTAL541221320541221320000000000
data
Cell Formulas
RangeFormula
E6:S6E6=SUM(E3:E5)
E20:S20,E9:S9E9=SUM(E7:E8)
E15:S15E15=SUM(E10:E14)
E17:S17E17=SUM(E16:E16)
S18:S19,S16,S10:S14,S7:S8,S3:S5,P18:P19,P16,P10:P14,P7:P8,P3:P5,M18:M19,M16,M10:M14,M7:M8,M3:M5,J18:J19,J16,J10:J14,J7:J8,J3:J5,G18:G19,G16,G10:G14,G7:G8,G3:G5G3=E3-F3


and so on every run macro should fill empty columns BTR,SALR
 

Excel Facts

Waterfall charts in Excel?
Office 365 customers have access to Waterfall charts since late 2016. They were added to Excel 2019.

Forum statistics

Threads
1,223,907
Messages
6,175,300
Members
452,633
Latest member
DougMo

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