![]() |
|
![]() |
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
![]()
Hi All
I am looking for a solution to the following problem: ...I need to create a mail merge of all students with grades in subjects they study for only. If they study for those subjects then i want to return the subject and grade under each students name. If they don't study for any subject, then i don't want to see the subject listed at all...e.g.: [originally posted here [URL="http://www.mrexcel.com/forum/excel-questions/966936-excel-mail-merge-return-column-headers-all-any-columns-values.html"] ..so the final outcome should be a single page with customized headers and merged fields like: Name: Mar Subjects: Science Term 1: 72 Science Term 2: 47 Science Term 3: 18Maths Term 2: 44 _________________________________next student record many thanks for your help |
#2
|
||||
|
||||
![]()
Assuming your data has a separate record (e.g. Excel row) per subject for student, you can use Word's Catalogue/Directory Mailmerge facility for this (the terminology depends on the Word version). 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. The field coding for this is complex. However, since the tutorial document includes working field codes for all of its examples, most of the hard work has already been done for you - you should be able to do little more than copy/paste the relevant field codes into your own mailmerge main document, substitute/insert your own field names and adjust the formatting to get the results you desire. For some worked examples, see the attachments to the posts at: https://www.msofficeforums.com/mail-...html#post23345 https://www.msofficeforums.com/mail-...html#post30327 http://windowssecrets.com/forums/sho...l=1#post928391 Another option would be to use a DATABASE field in a normal ‘letter’ mailmerge main document and a macro to drive the process. An example of this approach can be found at: http://answers.microsoft.com/en-us/o...1-1996c14dca5d The DATABASE field can even be used without recourse to a mailmerge. An example of such usage can be found at: https://www.msofficeforums.com/mail-...html#post67097 Alternatively, you may want to try one of the Many-to-One Mail Merge add-ins, from: Graham Mayor at http://www.gmayor.com/ManyToOne.htm; or Doug Robbins at http://bit.ly/1hduSCB In addition to a 'Many to One' merge, the latter handles: • Merge with Charts • Duplex Merge • Merge with FormFields • Merge with Attachments • Merge to Individual Documents • Merge, Print and Staple Alternatively, if it's just a matter of having separate fields (e.g. Excel columns) and a single record per student, you can use a normal merge and line suppression for empty lines, as described 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] |
![]() |
Tags |
columns, merge |
Thread Tools | |
Display Modes | |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Return Address mail merge | GeorgeLawshe | Mail Merge | 2 | 06-03-2016 11:04 AM |
![]() |
jhearing | Word Tables | 4 | 05-31-2016 06:20 AM |
Formula/function to return column names for matching values | GiJoe81 | Excel | 1 | 06-27-2015 12:13 AM |
Mail merge how to link mail merge field value to a column heading | dsummers | Mail Merge | 1 | 05-08-2014 02:59 PM |
![]() |
robby | Word | 3 | 04-18-2012 06:37 PM |