Is there a way to run a mailmerge that merges multiple rows into a table based on a key field?

mps80y

New Member
Joined
Apr 3, 2019
Messages
22
I am trying to do a mail merge from an excel file that has multiple rows for each employee. Each row lists an application or process they are not qualified for. The data is provided in an excel document and currently we are copying and pasting it into a word document to then sending to employees for them to undertake the training.

Basically I want some kind of check against the Employee_ID field and add to the table any courses listed on the excel document for that Employee_ID. When there are no more records then start a new page in the mail merge with the next Employee_ID and continue to do the same until all data is merged.

The excel file will be sorted using the Employee_ID field which is the key field as it unique to each Employee

Is there a way to do this as a mail merge?

My sample files are here RK Mail Merge - Google Drive

Sorry - I'm really new to this kind of mail merge and can't seem to find anything similar based on the searches I've done. I hope it makes sense - any suggestions would be greatly appreciated :)
 

Excel Facts

Best way to learn Power Query?
Read M is for (Data) Monkey book by Ken Puls and Miguel Escobar. It is the complete guide to Power Query.
Did you work out how to do this and if so, what was the best course of action?
I have a very similar document to create and have been struggling to find instructions that work for this type of document.

I would really appreciate your feedback.
 
Upvote 0
Hi there, not sure if you've already solved this but I think these links might help:

Database fields under Directory merge might be your solution, or you can also use the Merge add-ins stated in the links.
I've recently had this issue and Database fields really helped me-- though, if you use them in e-mail mail merge, you'd have to refresh for each person to be sent out.

Hope this helps!
 
Upvote 0
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:
Microsoft Word Catalogue/Directory Mailmerge Tutorial
or:
http://www.gmayor.com/Zips/Catalogue Mailmerge.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.

Depending on what you're trying to achieve, the field coding for this can be 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:
mail merge with duplicate names but different dollar amounts
Access to Word, Creating a list from multiple records

Another option would be to use a DATABASE field in a normal ‘letter’ mailmerge main document and a macro to drive the process. An outline of this approach can be found at:
https://answers.microsoft.com/en-us...g-tables/8bce1798-fbe8-41f9-a121-1996c14dca5d

Conversely, if you're using a relational database or, Excel workbook with a separate table with just a single instance of each of the grouping criteria, a DATABASE field in a normal ‘letter’ mailmerge main document could be used without the need for a macro. An outline of this approach can be found at:
https://answers.microsoft.com/en-us...gle-page/4edb4654-27e0-47d2-bd5f-8642e46fa103
For some working examples, see:
Mail Merge: Using One Excel File with Multiple Sheets
using mailmerge to include a grouped information in a letter - Page 2
Merge excel list into Word Receipt
(the second of these uses a macro to apply some additional formatting).

The DATABASE field can even be used without recourse to a mailmerge. An example of such usage can be found at: Mail merge into different coloumns

Alternatively, you may want to try one of the Many-to-One Mail Merge add-ins, from:
Graham Mayor at Merge Many To One ; or
Doug Robbins at OneDrive
 
Upvote 0

Forum statistics

Threads
1,224,813
Messages
6,181,118
Members
453,021
Latest member
Justyna P

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top