Results 1 to 5 of 5
  1. #1
    New Lounger
    Join Date
    Oct 2012
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    How to Use Mail Merge with conditions to show/hide some features

    Hi every one,
    I have an excel sheet that contains records of students names, classes & their chosen subjects out of the subjects taught in the school. So, some subjects are taken by all the students and other differ for each student.
    I need to output a report for each student that contains:
    1- Student's name & class
    2- Subjects chosen by this particular student. No other subjects
    3- In addition, I need to show in the report a table for each subject. The tables will be filled with marks manually.

    I used the mail merge in Ms Word to output a report for each student containing only part 1. I need a help to complete the report with the other two parts.

    followUp1.docx
    std2.xlsx

  2. #2
    Super Moderator
    Join Date
    Jan 2001
    Location
    Melbourne, Victoria, Australia
    Posts
    3,852
    Thanks
    4
    Thanked 259 Times in 239 Posts
    This is really a job for Microsoft Access rather than doing it in a mixture of Excel and Word. However, doing part 2 is relatively straightforward (see attached example). Select all and press Shift F9 to reveal the field codes to see how it is done. I have included a return inside the result for each hit to put each subject on a new line.

    The Part 3 request may be trickier than I assume but it appears to be the same type of merge. Are you asking that the sample doc you posted is intended to be customised for each student to remove the marking tables for each subject the student is NOT doing? If so, you can paste a table into the 'true' field result the same way the sample doc is done. The basic syntax for each field is as follows
    {If <mergefield> = x "true result" "false result"}
    Attached Files Attached Files
    Last edited by Andrew Lockton; 2012-10-15 at 07:33.
    Andrew Lockton, Chrysalis Design, Melbourne Australia

  3. #3
    Super Moderator
    Join Date
    May 2002
    Location
    Canberra, Australian Capital Territory, Australia
    Posts
    5,055
    Thanks
    2
    Thanked 417 Times in 346 Posts
    Cross-posted at: http://www.msofficeforums.com/mail-m...show-some.html
    For cross-posting etiquette, please read: http://www.excelguru.ca/content.php?184
    Cheers,

    Paul Edstein
    [MS MVP - Word]

  4. #4
    New Lounger
    Join Date
    Oct 2012
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Hi macropod,
    First of all, thank u for ur reply and help
    Second, thank u for the notice about "cross posting" and sorry for inconvenience. Actually I posted my problem into 2 forums with almost a day in between since I'm new in the forum and with no experience in using codes with mail merge in Ms Word. I did use simple mail merge before, but all the stuff with coding not yet dealing with.

  5. #5
    New Lounger
    Join Date
    Oct 2012
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Tanks Andrew for ur reply,
    I don't know how to insert a field as u did, and I tried to look & search for it but I don't have enough background to get the idea. Can u please explain it for me.
    one more thing, can u post ur replay in the other forum:
    http://www.msofficeforums.com/mail-m...show-some.html
    Sorry for inconvenience.

Posting Permissions

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