sort data in listbox based on selected row from another listbox

abdo meghari

Well-known Member
Joined
Aug 3, 2021
Messages
665
Office Version
  1. 2019
Hi,
I know this way could do that by textbox or combobox and there are lots of codes about it, but I would that by another list box .
so I have about 22 sheets and every sheet could contain 5000 rows for each sheet and different structure but all of data will be from row1.
so I would populate sheets name in listbox1 and when select item then sort data and show in listbox2.
here is sample data
Microsoft Excel‫‬.xlsx
ABCDEF
1ITEMCODEBRANDQTYUNIT PRICETOTAL
211221BS 205/70R15C R623 THI62.00405.0025,110.00
321227BS 215/70R15C R623 THI22.00425.009,350.00
431227BS 215/70R15C R623 THI4.00544.002,176.00
541241BS 1200R20 G580 JAP220.002,035.00447,700.00
651284GC 1200R20 AZ0026 CHI80.00895.0071,600.00
761284GC 1200R20 AZ0026 CHI50.001,125.0056,250.00
871285GC 1200R20 AZ0183 CHI40.00925.0037,000.00
981285GC 1200R20 AZ0183 CHI10.001,225.0012,250.00
1091285GC 1200R20 AZ0183 CHI60.001,205.0072,300.00
11101385GC 315/80R22.5 AT161 CHI20.00735.0014,700.00
12111294GC 315/80R22.5 AZ188 CHI20.00745.0014,900.00
13121287GC 315/80R22.5 AZ126 CHI60.00735.0044,100.00
14131305BS 700R16 R230 JAP2.00770.001,540.00
15141306BS 750R16 R230 JAP10.00775.007,750.00
16151306BS 750R16 R230 JAP4.00780.003,120.00
17TOTAL819,846.00
BRANDS
Cell Formulas
RangeFormula
F2:F16F2=D2*E2
F17F17=SUM(F2:F16)




Microsoft Excel ‫‬.xlsx
ABCD
1ITEMCODEBRANDQTY
211221BS 205/70R15C R623 THI20.00
321227BS 215/70R15C R623 THI15.00
431227BS 215/70R15C R623 THI10.00
541241BS 1200R20 G580 JAP10.00
651284GC 1200R20 AZ0026 CHI10.00
761284GC 1200R20 AZ0026 CHI5.00
871285GC 1200R20 AZ0183 CHI5.00
STOCK




before should populate sheets names in listbox1
vf.JPG


after select item from listbox1 should sort data in listbox2
as2.JPG



thanks
 

Excel Facts

What is the fastest way to copy a formula?
If A2:A50000 contain data. Enter a formula in B2. Select B2. Double-click the Fill Handle and Excel will shoot the formula down to B50000.

Forum statistics

Threads
1,225,606
Messages
6,185,956
Members
453,333
Latest member
BioCoder84

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