#1
|
|||
|
|||
Filter Mail Merge based on a list of filter criteria
Hi everybody,
Is there a way (I'm guessing VBA probably) that will: 1. filter my records for a mail merge output 2. print (to PDF) (ideally naming the file to my convention, sourced from another column in the filter list perhaps) 3. proceed to the first step again with the next filter criteria A little background/more detail: I am using mail merge to view Excel records (rows) in a "one-page" easy to read layout for a spare parts review process (using excel on a projector screen when it is DJ cols wide and 15,000 rows is painful to say the least). I am currently producing short reports based on a few fixed criteria (eg. "Value" greater than $500, "Plant" area) The third filter "Planner Group" changes for each report. I have to produce over 200 reports so doing it one-at-a-time is very time consuming (and potentially error prone of course) What I'd like to happen: I have a list of all the "Planner Group" codes I wish to use (in Excel of course). I'd like to (presumably by VBA macro) to filter the data on the fixed criteria then by the Planner Group code, merge to PDF print and give it a file name of my choosing. Ideally this name would be on the filter source list (or by any sequential filename (I'll rename with existing know-how) or manually during the merge process if I have to) Many thanks in advance for any help you could suggest (even just for reading too). Best regards, Darren |
#2
|
||||
|
||||
Instead of filtering by Planner Group code, you could have the mailmerge sort by it (and by other criteria as well), so that your outputs are grouped the way you want them. If you use Word's Catalogue/Directory Mailmerge facility for this (the terminology depends on the Word version), you can have it insert page breaks (or Section breaks) whenever the groupings change. No code required. To see how to do so with any mailmerge data source supported by Word, check out my Microsoft Word Catalogue/Directory Mailmerge Tutorial at:
http://windowssecrets.com/forums/sho...merge-Tutorial or: http://www.gmayor.com/Zips/Catalogue%20Mailmerge.zip The tutorial covers everything from list creation to the insertion & calculation of values in multi-record tables in letters. Do read the tutorial before trying to use the mailmerge document included with it. Having completed said merge, it's a simple-enough matter to saving the different portions of the file to uniquely-named PDFs. There's code for that in the Mailmerge Tips and Tricks 'Sticky' thread at the top of this forum: https://www.msofficeforums.com/mail-...ps-tricks.html
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#3
|
|||
|
|||
Thanks Paul.
I have had a quick look and it seems to answer what I need. I'll work through it and see if I can get it to work. Cheers, Darren |
Tags |
filter, filtering, vba |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Filter tasks with multiple criteria | markhad | Outlook | 0 | 03-15-2016 02:48 AM |
Complex Mail Merge based on Criteria | fairchance | Mail Merge | 11 | 08-22-2015 04:32 AM |
Mail merge with filter using data inputted by user | Tornado70 | Mail Merge | 6 | 04-09-2013 07:16 AM |
Forgotten Sort and Filter Criteria | rbdmg | Mail Merge | 0 | 10-31-2011 09:14 PM |
Applying Filter to mail merge crashes word!!! | sedain121 | Mail Merge | 1 | 06-28-2010 02:33 PM |