updating code combining data in listbox on userform across multiple sheets and calculate values

KalilMe

Active Member
Joined
Mar 5, 2021
Messages
343
Office Version
  1. 2016
Platform
  1. Windows
hello
first thank for mr. Dante for great help in this previous thread combining data in listbox on userform across multiple sheets and calculate values amongst them
second I hope see my thread and updating based on new requirments . I will take this sheet SS for example and it will apply with the same things others so I insert two columns after COLS B (ID) INVOICE NUMBER & CUSTOMER NUMBER . theses columns should not show at all when run userform and populate data in listbox . othere meaning your previous code should work when run userform as it 's without any change .
new requirements are relating by select sheet from combobox with add two optionsbuttons . so when run userform should select option button not combined then when select sheet should show data for selected sheet as in the sheet , but if I select optionbutton2(combined) then should merge duplicate items based on COL B with calculate the price average in the same selected sheet
COLLECTION (3).xlsm
ABCDEFGHIJ
1DATEIDINVOICE NUMBERCUSTOMER NUMBERBRTYORQTYPRICETOTAL
25/1/2021FR-1INV/FD-001CCS/SS-004FRBANANATT5.00$11.00$55.00
35/2/2021FR-2INV/FD-001CCS/SS-004FRAPPLELL10.00$10.00$100.00
45/3/2021FR-1INV/FD-002CCS/SS-005FRBANANATT15.00$12.00$180.00
55/4/2021FR-2INV/FD-003CCS/SS-006FRAPPLELL20.00$11.00$220.00
65/4/2021FR-1INV/FD-003CCS/SS-004FRBANANATT20.00$9.00$180.00
SS
Cell Formulas
RangeFormula
J2:J6J2=I2*H2


condition1 when select sheet , combined then it will merge and calculate the price average based on selected sheet
when there are different invoices and customers in COLS C,D for the same item should merge with comma as in mark in listbox
1.PNG



condition2 when select sheet and not combined
3.PNG

condition3 when search by textbx1
the search should FR-1 not fr1 as writting
4.PNG










5.PNG

7.PNG



for more details
case1 when select sheet and not combined should show data as in the selected sheet without any merge or calculate average
case2 when select sheet and combined should show ,merge and calculate average in the same sheet
case3 when select sheet and not combined and textbox1 based on COL B should show data as in the selected sheet without any merge or calculate average
case4 when select sheet and combined and textbox1 based on COL B should show ,merge and calculate average in the same sheet
case5 when show data in listbox when usrform and search in textbox1 should show based on col D
 

Attachments

  • 6.PNG
    6.PNG
    10.4 KB · Views: 6
  • 7.PNG
    7.PNG
    20 KB · Views: 5
  • 7.PNG
    7.PNG
    20 KB · Views: 7

Excel Facts

Format cells as currency
Select range and press Ctrl+Shift+4 to format cells as currency. (Shift 4 is the $ sign).

Forum statistics

Threads
1,214,991
Messages
6,122,628
Members
449,095
Latest member
bsb1122

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