populate average price on listbox based on selected sheet from combobox

Hasson

Active Member
Joined
Apr 8, 2021
Messages
401
Office Version
  1. 2016
Platform
  1. Windows
Hi
I need merging duplicates items based on column D for QTY in column E and show price average for column F and show in listbox based on selected sheet from combobox1 except STOCK sheet will show as in sheet without any price average.
each sheet should merging alone for duplicates items.
the data in sheets
list.xlsm
ABCDEFG
1DATENAMEINVOICIDQTYUNIT PRICETOTAL
201/01/2023AHHGGJ-1VVT/009FOOILLL-100220.00110.0024,200.00
301/01/2023AHHGGJ-1VVT/009FOOILLL-101100.00140.0014,000.00
401/01/2023AHHGGJ-1VVT/009FOOILLL-102110.00200.0022,000.00
501/01/2023AHHGGJ-1VVT/009FOOILLL-103340.00120.0040,800.00
602/01/2023AHHGGJ-2VVT/010FOOILLL-101120.00155.0018,600.00
702/01/2023AHHGGJ-2VVT/010FOOILLL-10060.00160.009,600.00
803/01/2023AHHGGJ-3VVT/011FOOILLL-10360.00155.009,300.00
903/01/2023AHHGGJ-3VVT/011FOOILLL-10160.00175.0010,500.00
1003/01/2023AHHGGJ-3VVT/011FOOILLL-10060.00144.008,640.00
1103/01/2023AHHGGJ-3VVT/011FOOILLL-10422.00134.002,948.00
1203/01/2023AHHGGJ-3VVT/011FOOILLL-10560.00133.007,980.00
BBR
Cell Formulas
RangeFormula
G2:G12G2=E2*F2



list.xlsm
ABCDEFG
1DATENAMEINVOICIDQTYUNIT PRICETOTAL
201/02/2023QTYY223SDFF/99FOOILLL-10010.00150.001,500.00
302/02/2023QTYY223SDFF/99FOOILLL-10110.00160.001,600.00
403/02/2023QTYY224SDFF/100FOOILLL-10220.00220.004,400.00
504/02/2023QTYY225SDFF/101FOOILLL-10315.00150.002,250.00
605/02/2023QTYY226SDFF/102FOOILLL-10112.00180.002,160.00
706/02/2023QTYY227SDFF/103FOOILLL-1005.00170.00850.00
807/02/2023QTYY228SDFF/104FOOILLL-1039.00185.001,665.00
908/02/2023QTYY229SDFF/105FOOILLL-1018.00166.001,328.00
1009/02/2023QTYY230SDFF/106FOOILLL-1004.00177.00708.00
1109/02/2023QTYY230SDFF/106FOOILLL-10220.00212.004,240.00
BMTR
Cell Formulas
RangeFormula
G2:G11G2=E2*F2


list.xlsm
ABCDEFG
1DATENAMEINVOICIDQTYUNIT PRICETOTAL
215/02/2023VRRR788VBN/900-90FOOILLL-10010.00110.001,100.00
316/02/2023VRRR789VBN/900-91FOOILLL-10110.00140.001,400.00
417/02/2023VRRR790VBN/900-92FOOILLL-10112.00200.002,400.00
518/02/2023VRRR791VBN/900-93FOOILLL-1005.00120.00600.00
619/02/2023VRRR792VBN/900-94FOOILLL-1039.00155.001,395.00
720/02/2023VRRR793VBN/900-95FOOILLL-1018.00144.001,152.00
821/02/2023VRRR794VBN/900-96FOOILLL-1004.00175.00700.00
VSR
Cell Formulas
RangeFormula
G2:G8G2=E2*F2
list.xlsm
ABCDEFG
1DATENAMEINVOICIDQTYUNIT PRICETOTAL
228/02/2023SDER4FGRT500-00FOOILLL-1005.00150.00750.00
301/03/2023SDER4FGRT500-00FOOILLL-1015.00160.00800.00
402/03/2023SDER4FGRT500-00FOOILLL-1025.00220.001,100.00
503/03/2023SDER4FGRT500-00FOOILLL-10310.00150.001,500.00
604/03/2023VRRR793FGRT500-01FOOILLL-1038.00166.001,328.00
705/03/2023VRRR794FGRT500-02FOOILLL-1034.00177.00708.00
806/03/2023VRRR794FGRT500-03FOOILLL-1014.00190.00760.00
STR
Cell Formulas
RangeFormula
G2:G8G2=E2*F2





list.xlsm
ABCDE
1ITEMIDQTYUNIT PRICETOTAL
21FOOILLL-10020.00112.002,240.00
32FOOILLL-101200.00145.0029,000.00
43FOOILLL-102100.00190.0019,000.00
54FOOILLL-10350.00165.008,250.00
65FOOILLL-104100.00120.0012,000.00
76FOOILLL-105400.00125.0050,000.00
87FOOILLL-106430.00133.0057,190.00
98FOOILLL-107213.00150.0031,950.00
109FOOILLL-108123.00180.0022,140.00
1110FOOILLL-109123.00170.0020,910.00
1211FOOILLL-110124.00155.0019,220.00
1312FOOILLL-11156.00128.007,168.00
1413FOOILLL-11217.00198.003,366.00
1514FOOILLL-11311.00189.002,079.00
1615FOOILLL-1141,234.00199.00245,566.00
STOCK
Cell Formulas
RangeFormula
E2:E16E2=C2*D2


when select sheet should merge the QTY and show average price to unit price column and QTY* UNIT PRICE in listbox for instance

LIS1.PNG



and if the combobox1 is empty then
will create names headers based on sheets names and show QTY every sheet after merge and the column QTY in listbox will calculate across sheets like this STOCK+BBR-BMTR+VSR-STR , but when creae unit price should be average price based on two sheets together STOCK,BBR when merge the ID
result when combobox1 is empty
LIS6.PNG

by the way I have 7500 rows for each sheet at least .
thanks
 

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)
Welcome to the MrExcel Message Board!

Cross-posting (posting the same question in more than one forum) is not against our rules, but the method of doing so is covered by #13 of the Forum Rules.

Be sure to follow & read the link at the end of the rule too!

Cross posted at:

There is no need to repeat the link(s) provided above but if you have posted the question at other places, please provide links to those as well.

If you do cross-post in the future and also provide links, then there shouldn’t be a problem.
 
Upvote 0

Forum statistics

Threads
1,223,884
Messages
6,175,177
Members
452,615
Latest member
bogeys2birdies

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