|
#1
|
|||
|
|||
Conditional list of names from Excel sheet
Hi all. I have a spreadsheet which has a list of people's names and their associated location, for example:
First Name Last Name Location Fred Bloggs London Peter Parker London Joe Bloggs Birmingham John Smith Birmingham What I want to do in Word is create a list of names for each location - so the end result would be: London: Fred Bloggs, Peter Parker Birmingham: Joe Bloggs, John Smith Is there a way to do this please? Many thanks, Doug. |
#2
|
||||
|
||||
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 Tutorialin the 'Sticky' threat at the top of this forum:
Microsoft Word Catalogue/Directory Mailmerge Tutorial 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. 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. 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: Many to one email merge using tables - Microsoft Community 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: Mail Merge - To a Word Table on a Single Page - Microsoft Community For some working examples, see: Mail Merge: Using One Excel File with Multiple Sheets Merge excel list into Word Receipt
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#3
|
|||
|
|||
Thanks for pointing me in the right sort of direction Paul. However, I'm not getting quite the result I want. At the moment, the output I'm getting is (using the example data above):
London Fred Bloggs London Peter Parker Birmingham Joe Bloggs Birmingham John Smith Why is the location being repeated for every entry? I just want a list of names after each location. Thanks. This is what I have in the merge doc: Pasteboard - Uploaded Image |
#4
|
||||
|
||||
Without wanting to place too fine a point on it, that field coding is not from my tutorial...
PS: When posting images, etc, kindly attach them to your post here, instead of on 3rd-party sites. You can do so via the paperclip symbol on the 'Go Advanced' tab at the bottom of this screen.
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#5
|
|||
|
|||
I tried the initial field coding in your tutorial and couldn't get that to work without erroring, so did a bit of Googling and found what I posted previously which got me further.
If I didn't need to try and sort this fairly quickly, I'd spend more time messing around trying to get the right field coding. But I'm really just looking for someone to be kind enough to show me the field coding required to achieve what I need to achieve please. If that's not possible, I'll seek help elsewhere. Many thanks, Doug. |
#6
|
|||
|
|||
OK, I've got further using the attached field codes - the only issue I have now is getting the names onto a single line rather than a list with each name on it's own line. Any help please?
|
#7
|
|||
|
|||
Sorted - Just had to move the trailing "} up onto the last line. Cheers.
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
How do I import list of names from excel to print placecards? | jrawls | Word | 2 | 08-17-2017 06:53 AM |
Adding names to sheet for printing | WV8VFD | Excel | 4 | 12-01-2013 11:02 PM |
How to import a list of names into PowerPoint from Excel? | CarpetRemnant | PowerPoint | 4 | 12-07-2012 11:08 AM |
link conditional info in word based on excel list | stijnvanhoof | Mail Merge | 1 | 11-13-2012 01:55 PM |
create tree list in excel sheet | chuikingman | Excel | 5 | 06-27-2011 09:38 AM |