• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Help with Advance Filtering using VBA

Greentee

New Member
Hello,

I'm trying to figure out a way to do some advance filtering using VBA(as the title suggests
smile.gif
) . Basically.. I'm trying to filter a table from a dropdown list in a different cell. Normally this would be fairly simple however, the way the table is set up is the values in the drop down are actual headers in the table. So, I want to filter the table for any cells that have VALUES for that column header that matches what's selected in the drop down.

I've attached an example of what I have so far. Perhaps someone could take a look and let me know if I'm even going in the right direction or if I need to learn something completely different. Please advise.

Thanks in advance!
 

Attachments

  • Example.xlsm
    18 KB · Views: 5
Hi, Greentee!

As a new user you might want to (I'd say should and must) read this:
http://chandoo.org/forum/forums/new-users-please-start-here.14/

And regarding your issue, a few doubts:
a) Cell A2 has validation against a list in worksheet 2, so what's the autofilter in cell A1 for? You can't place the table under the same column where filtering is applied.

b) When you say "filter the header that matches this value and filter for any cells that has a value in it", what do you mean by "a value in it"? Any non blank value or what? Could you please elaborate.

Regards!
 
Thanks for the new user info!

a. Sorry that autofilter doesn't mean anything. I think I just had it turned on on accident. I've since turned it off.

b. Yes, any non blank values. So it could be an "X" or "40%" etc. Just filter for anything that is not blank.

To further elaborate.. I would like to select from the dropdown in A2 for example "America". I would like the table to filter the "America" header for any cells that is not blank.

I'm still pretty new to VBA so I'm having difficulties. Any help would be greatly appreciated.

Thanks,
 
Hi, Greentee!

So with America you want to get displayed John, Scott & Darren, with Mexico Scott & Amanda, and with Japan John & Adam. But where do you want to get that displayed? Filtering table rows and hiding columns? If so what about Status cells at range C1:C2? It'll be only visible if Mexico is selected? And the Status column (E)?

Regards!
 
So I didn't want to copy the results to a separate table.. just looking to FilterInPlace. Also C1:C2 is something I'm trying to work on as well. Is it possible to just select one filter at a time and have the table below filter in place according to the recent change I made in either cell A2 or C2?
 
Back
Top