combining data in listbox on userform across multiple sheets and calculate values amongst them

KalilMe

Active Member
Joined
Mar 5, 2021
Messages
399
Office Version
  1. 2016
Platform
  1. Windows
hi experts
I have many sheets about five sheets contains data are almost 3000 rows for each sheet and it will increase continuiosly . so what I want when run the userform should merge the duplicate items based on COL B across the sheets each sheet repeat the items except the first sheet because this data collected from prevouis year. the others sheets are currnt year operations with considering the second sheet somtimes contains new item then should show in listbox . after merge duplicate items should show the QTY for each sheet . about COL 11 the calculate like this as item (FR1)=200+200-5+4-20=379 . as to COLS 12,13 (UNIT COST,UNIT SALES ) should not summing . should keep as it is .
as to COL 14 should calculate like this (15-12)*379=1137
see the row1 in listbox
so if any body have suggestion to do that by using helper sheet or doing directly without using helper sheet I accept all the suggestion .

COLLECTION (2).xlsm
ABCDEFGH
1ITEMIDBRTYORQTYUNIT COSTUNIT SALE
21FR-1FRBANANATT200.00$12.00$15.00
32FR-2FRAPPLELL100.00$11.00$17.00
43FR-3FRPEARNN60.00$12.00$15.00
54FR-4FRBANANAQQ55.00$13.00$17.00
65VEG1VEGTOMATOSS50.00$14.00$16.00
76VEG2VEGTOMATOAA50.00$11.00$15.00
86FR-5FR1PEARMM0.00$11.00$15.00
STA



COLLECTION (2).xlsm
ABCDEFGH
1DATEIDBRTYORQTYUNIT COST TOTAL
21/1/2021FR-1FRBANANATT100.00$12.00$1,200.00
31/2/2021FR-2FRAPPLELL50.00$11.00$550.00
41/3/2021FR-3FRPEARNN60.00$12.00$720.00
51/4/2021FR-4FRBANANAQQ60.00$13.00$780.00
61/5/2021VEG1VEGTOMATOSS65.00$14.00$910.00
71/6/2021VEG2VEGTOMATOAA40.00$11.00$440.00
81/7/2021FR-1FRBANANATT100.00$12.00$1,200.00
91/8/2021FR-5FR1PEARMM55.00$14.00$770.00
RPA
Cell Formulas
RangeFormula
H2:H9H2=G2*F2




COLLECTION (2).xlsm
ABCDEFGH
1DATEIDBRTYORQTYUNIT SALETOTAL
22/1/2021FR-1FRBANANATT5.00$15.00$75.00
32/3/2021FR-3FRPEARNN5.00$15.00$75.00
42/4/2021FR-4FRBANANAQQ2.00$17.00$34.00
52/5/2021VEG1VEGTOMATOSS3.00$16.00$48.00
62/6/2021VEG2VEGTOMATOAA4.00$15.00$60.00
72/8/2021FR-5FR1PEARMM2.00$15.00$30.00
82/8/2021FR-5FR1PEARMM2.00$20.00$40.00
SR
Cell Formulas
RangeFormula
H2:H8H2=G2*F2


COLLECTION (2).xlsm
ABCDEFGH
1DATEIDBRTYORQTYPRICETOTAL
23/1/2021FR-1FRBANANATT2.00$15.00$30.00
33/2/2021FR-3FRPEARNN2.00$15.00$30.00
43/3/2021FR-1FRBANANATT2.00$15.00$30.00
53/4/2021FR-3FRPEARNN2.00$15.00$30.00
RR
Cell Formulas
RangeFormula
H2:H5H2=G2*F2


COLLECTION (2).xlsm
ABCDEFGH
1DATEIDBRTYORQTYPRICETOTAL
21/1/2021FR-1FRBANANATT5.00$12.00$60.00
31/2/2021FR-2FRAPPLELL10.00$11.00$110.00
41/3/2021FR-1FRBANANATT15.00$12.00$180.00
51/4/2021FR-2FRAPPLELL20.00$11.00$220.00
SS
Cell Formulas
RangeFormula
H2:H5H2=G2*F2



the result should be in listbox

1.PNG



2.PNG
thanks in advance
 
sorry I delaed you but it makes me big confusing . som items don't calculate averege correctly . what happens ? see the highlighted unit cost by blue color for instance
FR2 should be (9+8+11)/3=9.333 but in listbox show 11
also FR5 should be (11+14)/2=12.5 but in listbox show 11

COLLECTION (2).xlsm
ABCDEFGH
1DATEIDBRTYORQTYUNIT COST TOTAL
21/1/2021FR-1FRBANANATT100.00$12.00$1,200.00
31/2/2021FR-2FRAPPLELL50.00$9.00$450.00
41/3/2021FR-3FRPEARNN60.00$12.00$720.00
51/4/2021FR-4FRBANANAQQ60.00$13.00$780.00
61/5/2021VEG1VEGTOMATOSS65.00$14.00$910.00
71/6/2021VEG2VEGTOMATOAA40.00$11.00$440.00
81/7/2021FR-1FRBANANATT100.00$14.00$1,400.00
91/8/2021FR-5FR1PEARMM55.00$14.00$770.00
101/9/2021FR-6FR1PEARMM56.00$15.00$840.00
111/10/2021FR-6FR1PEARMM57.00$16.00$912.00
121/11/2021FR-2FRAPPLELL50.00$8.00$400.00
RPA
Cell Formulas
RangeFormula
H2:H12H2=G2*F2

COLLECTION (2).xlsm
ABCDEFGH
1ITEMIDBRTYORQTYUNIT COSTUNIT SALE
21FR-1FRBANANATT200.00$13.00$15.00
32FR-2FRAPPLELL100.00$11.00$17.00
43FR-3FRPEARNN60.00$12.00$15.00
54FR-4FRBANANAQQ55.00$13.00$17.00
65VEG1VEGTOMATOSS50.00$14.00$16.00
76VEG2VEGTOMATOAA50.00$11.00$15.00
87FR-5FR1PEARMM0.00$11.00$15.00
98FR-6FR1PEARMM0.00$12.00$15.00
STA

1.PNG


2.PNG
 
Upvote 0

Excel Facts

Square and cube roots
The =SQRT(25) is a square root. For a cube root, use =125^(1/3). For a fourth root, use =625^(1/4).
yes in sheet SS is unit cost and RR unit sales , but should ignore them . the price average depends on sheets(STA,RPA,SR)
 
Upvote 0
In sheet "RPA" the title "UNIT COST " has a blank space on the right.
Then...
Titles must be exactly the same.
1632341754421.png
 
Upvote 0
awful! I don't believe this simple thing causes this problem.
actually I have a new requirements to complete this project . it's not fair to ask new requirements . as I see from the big code must take from you much more time to design it , and every time mod this code . so I will issue a new thread is linked with this thread contain the whole details . I hope from you complete your favor to achieve this project and see my new thread when you have time . this is your code and you know how it works and how should adjusting so if you see new thread when you have free time so I truly appreciate your help. I will issue in today or tommorrow .so it's up to you .
finally you achieved a great work today . thanks so much for your solution .:love:
 
Upvote 0
It is the problem of all systems, the quality of the information.

I'm glad to help you. Thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,224,824
Messages
6,181,187
Members
453,020
Latest member
Mohamed Magdi Tawfiq Emam

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