Create & Save filtered lists into PDF

  • Hi there, I've seen variations of this problem on this site (like here) as well as others, but I'm pretty much brand new to VBA so I'm struggling to fit other examples to my specific use case. The Excel Workbook I'm using has 9 tabs, 3 of which are data dump only tabs that, when filtered, generate the results on the other 6 tabs. The filter criteria is the same on each of the 3 tabs, in this case I'm using names. The process is like this:

    1. Filter Swanson, Ron on the 3 data dump tabs (name to be filtered is located in same column on each tab)

    2. Highlight the other 6 tabs

    3. Save as a PDF with password protection and page numbers

    4. Repeat with new name

    This seems a bit tricky, especially because I'd like the PDF outputs to be password protected and have page numbers. How can I have a macro that filters a name on 3 tabs and saves down the filtered result as a PDF with a password and page number? Any guidance is helpful. Thank you. :)

  • Thank you for your quick reply! That's helpful, I can take that step out if it isn't possible. So it would be same setup except not password protect.

  • Here is some code that I tried:


    There are a few issues with this code

    1. only filters on one data tab
    2. Although it seems to filter for Swanson, Ron properly and saves out an excel fairly quickly, going to the next name slows it down significantly and it filters everyone out except the first two names (ie Swanson, Ron and Knope, Leslie)
    3. creates dummy excel files named '1.xlsx' up to '9.xlsx' (before I stopped it) for just 3 filtered names.

    So, what I'd really like is to add some code for:

    1. all three data tabs to be filtered by name
    2. highlight only the first 6 tabs to be saved as PDF, add page numbers
    3. start process again for the next name (all in column B). I don't need excel files saved out this is just what I could find out there.

Participate now!

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