I am trying to put together a letter that takes data from a large table of real estate agents that have tenants who have received financial assistance for their Bond.
I have a letter that is the first page, that needs to include the field:
Landlord Name
Address
Suburb
Postcode
State
Then a table on the 2nd page that needs to include the fields:
Tenant Name
Property Street Address
Property Suburb
Property Bond Number
Bond Amount
Date Paid
I have tried to use formulas to get this to work, but I can only get a separate letter for each landlord and each tenant.
I need a letter for each landlord with a list of their tenants in each letter - so some may have one tenant and some may have twenty tenants.
I think the most efficient way would be to provide the list of tenants in a separate form to send with the letter.
Simply run the macro in the attached workbook. I have added an option to print each sheet if you want. A simple mail merge with word can produce the letters Copy-of-DATA---Test-Data-Bond-Revie.xlsm
Angela Percy
ASKER
Roy_Cox, thank you. I ran the macro but it only populated each worksheet with the headings - not the actual data. Have I done something wrong?
Roy Cox
Soryy, I must have uploaded before saving my final code. Try this
I'm off to work now, but if you need any further adjustments I'll look at it later.
It worked! Thank you so much - I will try it on some real data and see how I go.
Thanks again.
Roy Cox
I'll check back later
Helen Feddema
This would be much easier to do in Access, if it is possible to store the data in Access tables. My Access Archon #44 has an example of creating Word documents from tables in a one-to-many relationship (the "many" items are placed into a Word table, which can expand to as many rows as needed).
However, it is an old format database, and you may not be able to open it. I am attaching a slightly updated (Access 2000) version of this database; you will need to edit the templates path for your computer. Or for an updated and more sophisticated version, see the 4th edition of my Working with Word ebook, available from Office Watch.
Thank you Helen for your suggestion, it certainly is what I want to achieve, however we are not permitted to use Access within our workplace. Thanks again.
Roy Cox
Unfortunately, many places of work do not use Access.
Did the code that I provided work with real data, providing that the data was laid out as in the example you should have had no problem
Angela Percy
ASKER
It did work thank you. I'd still really like to incorporate it into a one step mail merge - but it doesn't look like that is possible.
You could do it all from Excel if you post a copy of the letter I'll see whether it can be done.
Angela Percy
ASKER
Hi Roy - there has been a slight change in the information within the report we are getting the data for the letters from. I've highlighted the cells where we need to extra the data from into the letter (attached). TEST-Data---Mailmerge.xlsx Let---Bond-Review---Lessor---DRAFT-.docx
Roy Cox
Hi
I'll see what I can do with these for you. I'm busy at work but I'll take a look as soon as I can
Simply run the macro in the attached workbook. I have added an option to print each sheet if you want. A simple mail merge with word can produce the letters