Consulting

Results 1 to 6 of 6

Thread: Solved: Explanation of Advanced Filter

  1. #1

    Solved: Explanation of Advanced Filter

    I've never used advanced filter before except to filter out duplicates. Now I need to filter out duplicates and anything that has a 0 or a negative number and I'm hopelessly lost. I've attached an example worksheet.

    Thanks for the help!

  2. #2
    Administrator
    VP-Knowledge Base
    VBAX Grand Master mdmackillop's Avatar
    Joined
    May 2004
    Location
    Scotland
    Posts
    14,489
    Location
    Have a look at this
    MVP (Excel 2008-2010)

    Post a workbook with sample data and layout if you want a quicker solution.


    To help indent your macros try Smart Indent

    Please remember to mark threads 'Solved'

  3. #3
    OOOHHHH! Now I get it! One more question, does the criteria range have to be on the worksheet or can it be somewhere else? I'll be looping through multiple workbooks and using the same criteria.

    Thanks!

  4. #4
    Administrator
    VP-Knowledge Base VBAX Grand Master mdmackillop's Avatar
    Joined
    May 2004
    Location
    Scotland
    Posts
    14,489
    Location
    If you are using VBA, I think the Criteria range can be anywhere.
    MVP (Excel 2008-2010)

    Post a workbook with sample data and layout if you want a quicker solution.


    To help indent your macros try Smart Indent

    Please remember to mark threads 'Solved'

  5. #5
    Mac Moderator VBAX Guru mikerickson's Avatar
    Joined
    May 2007
    Location
    Davis CA
    Posts
    2,778
    Both the Copy to Range (if copying to different location) and the Criteria range can be on different sheets (or different workbooks) than the List Range or each other.

    When diriven by VBA, fully qualifying the various arguments of .AdvancedFiter will be sufficient.

    From the keyboard:
    The sheet of the Copy To Range must be active when AdvancedFilter is pressed.

    If the copy to remote location option is not being used, the sheet with the Criteria Range must be active when AdvancedFilter is pressed.

    If the wrong sheet is active, a misleading error message results.

    As I mentioned above, when invoked from VBA, it doesn't matter which sheet is active.

  6. #6
    Thank you!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •