complicated macro transpose horizontal data through multiple sheets

KalilMe

Active Member
Joined
Mar 5, 2021
Messages
343
Office Version
  1. 2016
Platform
  1. Windows
hello
I search for macro to transpose data from multiple sheets ( BUYING,SELLING,RETSEL,RETBUY) to sheet RESULT . I put the expected result in sheet RESULT
NOTE : 1- if there is duplicate item should sum the repeated item based on column B for COL F (QTY)
2- the headers about ( BUYING,SELLING,RETSEL,RETBUY) in sheet RESULT brings the QTY based on sheets names(( BUYING,SELLING,RETSEL,RETBUY)
3- about the BALANCE ,COSTING,SELLENG I put the formula how should calculate , but shouldn't show the formulas .
4- about COST AVERAGE PRICE should calculate price average from sheet BUYING because sometimes there items change the price and the same thing about SALE AVERAGE PRICE should calculate price average from sheet SELLING .
5- if there cells are empty should be mark "-" into cells
6- my real data for each sheet about 1200 rows at least and increase every time
finally if it's possible create the whole data in sheet RESULT with headers and borders and formatting with considering every time run the macro should replace data.


TR.xlsm
ABCDEFGH
1DATECODEGOODSTYPEPRQTYUNIT PRICETOTAL
201/01/2021FR-00BANANAFOPL11.0012.00132.00
302/01/2021FR-01APPLEFRPPL10.0014.00140.00
403/01/2021FR-02PEACHFRLLP20.0015.00300.00
504/01/2021FR-03PEARFRTTL30.0012.00360.00
605/01/2021FR-04STRWBERRAYFRMML25.0020.00500.00
706/01/2021FR-05GRAPESFRTTL11.0025.00275.00
807/01/2021FR-00BANANAFOPL11.0012.00132.00
BUYING
Cell Formulas
RangeFormula
H2:H8H2=F2*G2





TR.xlsm
ABCDEFGH
1DATECODEGOODSTYPEPRQTYUNIT PRICETOTAL
201/02/2021FR-00BANANAFOPL5.0015.0075.00
302/02/2021FR-01APPLEFRPPL2.0016.0032.00
403/02/2021FR-02PEACHFRLLP3.0016.0048.00
504/02/2021FR-03PEARFRTTL2.0014.0028.00
605/02/2021FR-04STRWBERRAYFRMML10.0022.00220.00
706/02/2021FR-01APPLEFRPPL2.0015.0030.00
807/02/2021FR-02PEACHFRLLP3.0013.0039.00
SELLING
Cell Formulas
RangeFormula
H2:H8H2=F2*G2


TR.xlsm
ABCDEFGH
1DATECODEGOODSTYPEPRQTYUNIT PRICETOTAL
201/03/2021FR-00BANANAFOPL5.0015.0075.00
302/03/2021FR-01APPLEFRPPL2.0016.0032.00
403/03/2021FR-02PEACHFRLLP3.0016.0048.00
504/03/2021FR-03PEARFRTTL2.0014.0028.00
606/03/2021FR-03PEARFRTTL1.0014.0014.00
RETSEL
Cell Formulas
RangeFormula
H2:H6H2=F2*G2


TR.xlsm
ABCDEFGH
1DATECODEGOODSTYPEPRQTYUNIT PRICETOTAL
215/03/2021FR-00BANANAFOPL5.0015.0075.00
316/03/2021FR-01APPLEFRPPL2.0016.0032.00
417/03/2021FR-01APPLEFRPPL1.0016.0016.00
RETBUY
Cell Formulas
RangeFormula
H2:H4H2=F2*G2


TR.xlsm
ABCDEFG
1ITEM123456
2CODEFR-00FR-01FR-02FR-03FR-04FR-05
3BUYING22.0010.0020.0030.0025.0011.00
4SELLING5.004.006.002.0010.00-
5RETSEL5.002.003.003.00--
6RETBUY5.003.00----
7BALANCE17.005.0017.0031.0015.0011.00
8COST AVERAGE PRICE 13.0014.0015.0012.0020.0025.00
9SALE AVERAGE PRICE 15.0015.5014.5014.0022.00-
10COSTING221.0070.00255.00372.00300.00275.00
11SELLING255.0077.50246.50434.00330.00-
RESULT
Cell Formulas
RangeFormula
B7:G7B7=B3-B4+B5-B6
B10:G10B10=B8*B7
B11:G11B11=B9*B7

thanks in advance
 

Excel Facts

Quick Sum
Select a range of cells. The total appears in bottom right of Excel screen. Right-click total to add Max, Min, Count, Average.

Forum statistics

Threads
1,215,470
Messages
6,124,992
Members
449,201
Latest member
Lunzwe73

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