PDA

View Full Version : how merge and unmerge duplictes items in listbox on userform



maghari
11-15-2021, 02:19 AM
hi experts
I hope finding solution here . the current code when run userform it will show data and when write item in textbox1 based on column B it will bring data are relating the item in textbox1. now I add two optionbuttons(average & sum) .so after show data based on written item in textbox1 when select optionbutton " average" then it will merge duplicate item based on column(2) and sum values based on column (4) in listbox and calculate price average in column (5) in listbox and the column (6)= column (4) x column(5) . and when select the optionbutton "SUM" then should returen data for item is written in textbox1


so I put three pictures in second sheet. this my imagine how should work in listbox on userform
pic1 it works without codes optionbuttons. it's ok
but pic2,pic3 are problem when starts selecting optionbuttons


I really appreciate if anybody helps me.