Solved

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

Posted on 2016-08-24
5
105 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

You need to know the location of the Office templates folder, so that when you create new templates, they are saved to that location, and thus are available for selection when creating new documents.  The steps to find the Templates folder path are …
This article describes how you can use Custom Document Properties to store settings and other information in your workbook so that they will be available the next time you open the workbook.
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…

626 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