Solved

Only use the last record in an Excel sheet with a Word mail merge

Posted on 2016-08-24
5
56 Views
Last Modified: 2016-08-24
If I have an Excel sheet and I want to set up a mail merge so that it only picks up the last record entered...how do I set that up? Thanks
0
Comment
Question by:agwalsh
5 Comments
 
LVL 20

Assisted Solution

by:n2fc
n2fc earned 125 total points
ID: 41768348
After setting up the mail merge, use the "Select Recipients" and "Edit Recipient List" buttons to select ONLY the last entry...

See: https://support.office.com/en-us/article/Mail-merge-using-an-Excel-spreadsheet-858c7d7f-5cc0-4ba1-9a7b-0a948fa3d7d3

... for a more detailed explanation & tutorial video...
0
 
LVL 32

Assisted Solution

by:Rob Henson
Rob Henson earned 125 total points
ID: 41768362
If this is to occur on multiple occasions and on each occasion you want to only send mail to new entries into the list, I would add a field into the Excel sheet for "Mail Sent" and update the list each time mail is sent with a Y.

This field can then be used as a filter in the Mail Merge to filter the recipients to only those with blank in the Mail Sent field.

Thanks
Rob H
0
 
LVL 18

Accepted Solution

by:
xtermie earned 250 total points
ID: 41768369
You can do your merge for selected records only
From your main document, go to the Mailings tab of the ribbon
Select the last record using the |> button
Do your merge for the last record only in Finish & Merge, by choosing current record only

If you want to automate this, you can use a macro (and assign it to a button on the quick access toolbar maybe in the document you have)
Sub mergelastrecord()
Dim wdOutputName As String
Dim wdInputName As Document
Dim x As Integer

Const wdDefaultLastRecord = 10 '(set last record)
wdOutputName = ThisDocument.Path & "\MyForm2.docx"
Set wdInputName = Application.ActiveDocument

With wdInputName.MailMerge
    .Destination = wdSendToNewDocument
    .SuppressBlankLines = True
    With .DataSource
        .LastRecord = wdInputName.MailMerge.DataSource.RecordCount
    End With
    .Execute Pause:=False
End With

' show and save output file
Application.Visible = True
Application.ActiveDocument.SaveAs wdOutputName

' cleanup
wdDoc.Close SaveChanges:=False
Set wdDoc = Nothing

End Sub

Open in new window

0
 

Author Comment

by:agwalsh
ID: 41768462
Thanks to all of you. Excellent variety of possible solutions..
0
 

Author Closing Comment

by:agwalsh
ID: 41768464
Excellent variety of solutions for users at different levels. Thanks as always - knew EE would come through :-)
0

Featured Post

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Excel Spacing Anomaly 4 24
Need to put a web footnote into a text book 7 22
Excel format formula for currency 15 24
Data Copy 4 26
I would like to show you some basics you can do with Mailings in MS Word. It´s quite handy feature you can use for creating envelopes, labels, personalized letters etc. First question could be what is this feature good for? Mailing can really he…
This is written from a 'VBA for MS Word' perspective, but I am sure it applies to most other MS Office components where VBA is used.  One thing that really bugs me is slow code, ESPECIALLY when it's mine!  In programming there are so many ways to…
This Micro Tutorial demonstrates how to create Excel charts: column, area, line, bar, and scatter charts. Formatting tips are provided as well.
This Experts Exchange video Micro Tutorial shows how to tell Microsoft Office that a word is NOT spelled correctly. Microsoft Office has a built-in, main dictionary that is shared by Office apps, including Excel, Outlook, PowerPoint, and Word. When …

822 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question