+ Reply to Thread
Results 1 to 9 of 9

How to use Advanced Filter unique values as criteria

  1. #1
    Registered User
    Join Date
    09-15-2020
    Location
    Lithuania
    MS-Off Ver
    2019
    Posts
    84

    How to use Advanced Filter unique values as criteria

    I am trying to use Advance filter option in macro, to get unique entries in range of collumn, and then use that array as entries to loop through the code for exporting tables to PDF.
    Export to pdf (1st code) works. I just can't figure how to refer the unique values of filter for search and naming of exported pdf.
    2nd code is for Advanced autofilter. SO far I was able to find how to copy unique cells to specific location.
    But linking that to loop (preferably without pasting anywhere, would be a solution here. Can someone help me with this?

    HTML Code: 

    and this next piece of code is for finding AdvancedFILTER unique values:

    HTML Code: 
    Attached Files Attached Files
    Last edited by windzz; 11-10-2021 at 02:20 PM.

  2. #2
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2021 (Windows)
    Posts
    7,900

    Re: How to use Advanced Filter unique values as criteria

    Hi, you use the data from the unique list (advanced filter results) as criterium for the larger table, but you have to clear the criterium BEFORE you set the next one.
    I'll download your file and see what I can do do but this is just based upon what you ask and what I think should do the job

    PLEASE when you rename a file do that from within not outside because the you get invalid sour links to 559.32-51 MAIN.xlsm
    Last edited by Keebellah; 11-11-2021 at 03:56 AM.
    ---
    Hans
    "IT" Always crosses your path!
    May the (vba) code be with you... if it isn't; start debugging!
    If you like my answer, Click the * below to say thank-you

  3. #3
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2021 (Windows)
    Posts
    7,900

    Re: How to use Advanced Filter unique values as criteria

    This macro should do the trick:
    Please Login or Register  to view this content.
    See the 5 of the 8 attached pdf files as result of this macro
    Attached Files Attached Files

  4. #4
    Forum Expert
    Join Date
    08-17-2007
    Location
    Poland
    Posts
    2,161

    Re: How to use Advanced Filter unique values as criteria

    A slightly different way. No advanced filter.
    Please Login or Register  to view this content.
    Artik

  5. #5
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,122

    Re: How to use Advanced Filter unique values as criteria

    Slight simplification...
    Please Login or Register  to view this content.
    Good Luck
    I don't presume to know what I am doing, however, just like you, I too started somewhere...
    One-day, One-problem at a time!!!
    If you feel I have helped, please click on the star to left of post [Add Reputation]
    Also....add a comment if you like!!!!
    And remember...Mark Thread as Solved.
    Excel Forum Rocks!!!

  6. #6
    Registered User
    Join Date
    09-15-2020
    Location
    Lithuania
    MS-Off Ver
    2019
    Posts
    84

    Re: How to use Advanced Filter unique values as criteria

    Wow. Thank You guys:
    @sintek
    @Artik
    @Keebellah
    all of your codes worked! Seriously and they are so different. There is a lot to learn for me here.
    In the end I have also managed to write the working code, with a little bit of twist upgrade.
    This code works from external file (which I thought in the end, might be useful). Although I can't seem to delete the Temporary VBA Sheet for referred file, so I ended up not saving the external file after export. so it kind of works too.

    Here's the code. Any comments are welcome.:

    HTML Code: 

  7. #7
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2021 (Windows)
    Posts
    7,900

    Re: How to use Advanced Filter unique values as criteria

    You'll have to take a look at the code to see the differences.
    The code could use a cleanup but if it works for you, who am I to say otherwise
    Please Login or Register  to view this content.

  8. #8
    Registered User
    Join Date
    09-15-2020
    Location
    Lithuania
    MS-Off Ver
    2019
    Posts
    84

    Re: How to use Advanced Filter unique values as criteria

    Thank you, @Keebellat for replying!
    I have noticed you removed this entry

    HTML Code: 
    probably vba does not understand which workbook sheets to check. But since the test VBA must always be deleted, it works as a charm! Thank you!
    One more magnificent solution from you, Kudos!

  9. #9
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2021 (Windows)
    Posts
    7,900

    Re: How to use Advanced Filter unique values as criteria

    VBA only understands what YOU tell it to do en that’s what the parameter does

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Get unique values with VBA (advanced filter)
    By esbencito in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 12-10-2018, 10:37 PM
  2. Replies: 5
    Last Post: 12-19-2013, 06:58 AM
  3. Posting Unique Values (Other Than Using Advanced Filter)
    By brandnew22 in forum Excel General
    Replies: 2
    Last Post: 08-06-2013, 08:55 AM
  4. Advanced filter to get unique values
    By brumbarchris in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 01-13-2012, 12:21 PM
  5. Advanced Filter - Unique Values Macro Returns 1st Value Twice
    By r101 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 01-11-2011, 05:53 PM
  6. Advanced Filter - unique cell value as one of the criteria
    By efm in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 05-20-2010, 03:43 AM
  7. Advanced Filter - Unique Values
    By EstherJ in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 08-22-2005, 09:05 AM

Tags for this Thread

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1