match & copy data amongs sheets and summing repeted

KalilMe

Active Member
Joined
Mar 5, 2021
Messages
343
Office Version
  1. 2016
Platform
  1. Windows
hello
I have sheet report should match COLUMN B,C,D for each item A with the others sheets are the same thing COL B,C,D for item A . if they're matched then should insert three columns (PURCHASE, SALES ,BALNCE) and pull the values from the others sheets , and if there repeat the data cross multiple sheets . then should summing the values and if there are new data for each item is existed should add a new data in sheet report before row which contains word TOT as in case1 , and if when run macro again will add a new month and insert three columns (PURCHASE, SALES ,BALNCE) should apply all of conditions in case 2 as I have ever metioned in case 1.
and so on run macro repeatedly should insert three columns and pull the values , summing the values are repeated across all sheets except sheet REPORT and add a new data based on COL B,C,D for each item before row is TOT if the item is existed in sheet report and if there is new item in COL A then should add to the bottom



first
COLLECTION (1) (1) (1).xlsm
ABCDEF
1CODEBRTYORPURCHASESALES
2FR-00FRBANANATT20010
3FRAPPLELL10020
4FRPEARNN10-
5FRBANANAQQ20-
6VEG-00VEGTOMATOSS12-
7VEGTOMATOAA1212
8FO-00TUNA180GTH205
9TUNA180GIND10
SAS


second
COLLECTION (1) (1) (1).xlsm
ABCDE
1CODEBRTYORSALES
2FR-00FRBANANATT5
3FRAPPLELL2
4FRPEARNN3
5FRBANANAQQ-
6VEG-00VEGTOMATOSS5
SS



third

COLLECTION (1) (1) (1).xlsm
ABCDE
1CODEBRTYORPURCHASE
2FR-00FRAPPLELL120
3FRPEARNN30
4FRBANANAQQ40
5VEG-00VEGTOMATOSS50
6VEGTOMATOAA5
7VEGONIONAA16
8VEGPOTATOAA27
SR


fourt before result

COLLECTION (1) (1) (1).xlsm
ABCD
2CODEBRTYOR
3FR-00FRBANANATT
4FRAPPLELL
5FRPEARNN
6FRBANANAQQ
7TOT
8VEG-00VEGTOMATOSS
9VEGTOMATOAA
10VEGONIONAA1
11TOT
REPORT

result in sheet fourth in two cases
case1

COLLECTION (1) (1) (1).xlsm
ABCDEFG
1JAN
2CODEBRTYORPURCHASESALESBALANCE
3FR-00FRBANANATT20015185
4FRAPPLELL22022198
5FRPEARNN40337
6FRBANANAQQ60-
7TOT52040420
8VEG-00VEGTOMATOSS62557
9VEGTOMATOAA1717-
10VEGONIONAA16-6
11VEGPOTATOAA27-7
12TOT922270
13FO-00TUNA180GTH20515
14TUNA180GIND10010
15TOT30525
CASE1
Cell Formulas
RangeFormula
G13:G14,G8:G11,G3:G5G3=E3-F3
E12:G12,E7:G7E7=SUM(E3:E6)
E15:G15E15=SUM(E13:E14)

case2
COLLECTION (1) (1) (1).xlsm
ABCDEFGHIJ
1JANFEB
2CODEBRTYORPURCHASESALESBALANCEPURCHASESALESBALANCE
3FR-00FRBANANATT2001518520015370
4FRAPPLELL2202219822022198
5FRPEARNN4033740337
6FRBANANAQQ60-60-60
7TOT5204042052040665
8VEG-00VEGTOMATOSS62557625114
9VEGTOMATOAA1717-1717-
10VEGONIONAA16-66-12
11VEGPOTATOAA27-77-14
12TOT9222709222140
13FO-00TUNA180GTH2051520530
14TUNA180GIND1001010020
15TOT3052530550
CASE2
Cell Formulas
RangeFormula
J4:J6,G13:G14,G8:G11,G3:G5G3=E3-F3
E12:J12,E7:J7E7=SUM(E3:E6)
J3,J13:J14,J8:J11J3=G3+H3-I3
E15:J15E15=SUM(E13:E14)

note: the highlighted by red to see the differnce before and after
if this is not clear please informe me .
thanks
 

Excel Facts

Does the VLOOKUP table have to be sorted?
No! when you are using an exact match, the VLOOKUP table can be in any order. Best-selling items at the top is actually the best.
This requires VBA that I am not familiar with. Hope someone can gives help.
 
Upvote 0

Forum statistics

Threads
1,214,646
Messages
6,120,718
Members
448,986
Latest member
andreguerra

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