Posts by actuarish

    Re: Autofilter data based on listbox selections

    Thanks, actually I had tried earlier before seeking your help, only that my code filters out the ENTIRE data range i.e all the data is invisible. This is so even if selections are made in only one listbox. I am relatively new to VBA (barely 5 months),and I am not very good with arrays, so I hoped for some kind of a loop to loop through all the listboxes.

    Anyway, this is what I had:

    Please direct me further. Thanks.

    Re: Autofilter data based on listbox selections

    THANKS ! That worked PERFECTLY !!I also appreciate your quick response, the explanation of how it works and why my code failed.

    I hope I wont be bothering you if i sweetened it further. How would it be if I had THREE multi-select Listboxes ?
    i.e I want to provide the user a form interface where he can select any values from three listboxes and filter the same data range
    selections in listbox1 will filter column 1, selections in listbox2 will filter column 2, and so on, up to listbox3. If selections are made on ALL the listboxes, then the data would represent values meeting ALL the selection criteria.

    I dont know much about Arrays but am sure there is a way to Loop through all the Listbox selections.

    Once again, thanks for the help.


    Iam trying to auto filter a data range based on criteria passed from a list box selections.I want the auto filter to be filtering column 2 of the data range based on ALL the items SELECTED from a multi-select list box (named listbox2) at the click of a button. Here is what i currently have:

    It works, only that it filters the data by ONLY the last selected value of the list(i.e only one value item in the list). I want it to loop through ALL the selections, applying filter on column 2 based on EACH of the selections on the list box.

    Thanks in anticipation.