listbox vs filter

  • Hi folks,

    I have a userform containing a listbox. In this listbox, theres data imported from a column ("vendor list") in a big spreadsheet.
    What i need to do is to give the user the capability to filter the big spreadsheet by selecting lines in the listbox.

    The listbox has to act like a filter for the column "vendor list". By filtering that column the user will see the rows corresponding to his selection n the big spreadsheet.

    Can anybody help me with this. I assume its a small vba code.

    Thanks to the Gurus

  • Re: listbox vs filter

    yeah i kow that theres this option in excel 2007, but :
    1- i am using excel 2003
    2- i am asked to build a user friendly userform, so the users wont need to go into the big spreadsheet and filter.

    I know it could be done in easier ways but thats what is asked from me.

    Any suggestions ??

  • Re: listbox vs filter

    Use Advanced Filter with criteria.

    Set up a sheet that contains the filter criteria cells: at minimum, a header cell same as the vendor header cell on source sheet, and criteria cell(s) to hold the list box selection(s)

    Transfer the list box selection(s) to the criteria cells, then run the advanced filter.
    The criteria cells may be hidden.

    Search on using Advanced Filter if you are unfamiliar with this feature.
    It requires headers in the source data and matching headers in the criteria cells. It will handle multiple criteria.

    You could record a macro to get started and then post the code or a sample workbook for further help.

    Tip: before running the filter on subsequent uses be sure to include in your code a line to first clear the paste area for the results so that you always have only the exact data from each filter action.

  • Re: listbox vs filter

    hi again,

    Can you please explain to me step by step how to "Transfer the list box selection(s) to the criteria cells"

    I made a new column in the same sheet cntaining all the criteria cells.

    I created a listbox and i chose that column as it input range. When i select any ooption, nothing happens, the data sheet stays intact !!!

    Any help ?

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!