#1
|
|||
|
|||
Group multiple rows from Excel to Word - Mail Merge
Hi,
I have an excel file which contains data about customers and their purchase products. Each customer has their own ID and this is my starting point. Since one customer has more products, I need to specify the products into one page when doing mail merge, instead of creating multiple pages per customer. The text would look like this (just as an example): Dear ----, Thank you for your purchase. Please find below all the products that you have purchased from us: ------------ I would really appreciate your help on this, as I need to figure it out as soon as possible. I tried the tutorials provided in some previous threads, but i have no knowledge in coding, so if you have anything that explains the process with baby steps I will highly appreciate it. I use Word 365 and I think this additionally makes it harder to figure out the mail merge. |
#2
|
||||
|
||||
See Merge Many To One
Sort the data on the ID column and set a one row table containing the merge fields you wish to include in the table. See the example files.
__________________
Graham Mayor - MS MVP (Word) (2002-2019) Visit my web site for more programming tips and ready made processes www.gmayor.com |
#3
|
|||
|
|||
Hi gmayor,
Thanks a lot for taking the time to review my issue. The thing is that i am not sure if i am allowed to use many to one at work. Is there any other option I could use? I tried some of the codes/formulas provided in other threads but they seem not to work with Word 365. Thanks a lot! |
#4
|
||||
|
||||
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 in the ''Sicky' tread at the top of this forum:
https://www.msofficeforums.com/mail-...-tutorial.html 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: https://www.msofficeforums.com/mail-...html#post23345 https://www.msofficeforums.com/mail-...html#post30327 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/...1-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/...f-8642e46fa103 For some working examples, see: https://www.msofficeforums.com/mail-...-multiple.html https://www.msofficeforums.com/mail-...tml#post151706 https://www.excelforum.com/excel-gen...ml#post5110813 (the second of these uses a macro to apply some additional formatting).
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#5
|
|||
|
|||
My internet filter can delay my downloading the zip file attached in the Word Catalouge/Directory Tutorial Sticky thread by a day or two. I'm trying to get something done within the next few hours. Would you be able to email the file?
|
Tags |
mail merge, mail merge code, word 365 |
Thread Tools | |
Display Modes | |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Excel/Word Mail Merge - Same Address...different names/Rows | doucecool67 | Mail Merge | 1 | 05-31-2019 03:37 PM |
Mail Merge for multiple rows for the same name | lfcreds11 | Mail Merge | 1 | 09-25-2018 02:51 PM |
Mail merge multiple rows | eduzs | Mail Merge | 3 | 09-03-2018 04:56 AM |
Mail Merge Multiple Rows -word(from Spain) | luisaranda | Mail Merge | 6 | 03-06-2016 09:32 AM |
Mail Merge multiple rows? | ender541 | Mail Merge | 1 | 08-21-2012 03:14 PM |