Solved

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

Posted on 2016-08-24
5
66 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 33

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

Active Directory Webinar

We all know we need to protect and secure our privileges, but where to start? Join Experts Exchange and ManageEngine on Tuesday, April 11, 2017 10:00 AM PDT to learn how to track and secure privileged users in Active Directory.

Question has a verified solution.

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

Introduction This Article briefly covers methods of calculating the NPV and IRR variants in Excel as well as the limitations in calculating and interpreting IRR results. Paraphrasing Richard Shockley, author of my favourite finance reference tex…
A few years ago I was very much a beginner at VBA, and that very much remains the case today.  I'll do my best to explain things as I go in the hope that other beginners can follow.  If you just want to check out a tool that creates a Select Case fu…
This Micro Tutorial will demonstrate in Google Sheets how to use the HYPERLINK function to create live links inside your spreadsheet.
This Micro Tutorial demonstrates in Microsoft Excel how to consolidate your marketing data by creating an interactive charts using form controls. This creates cool drop-downs for viewers of your chart to choose from.

820 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