How To Do a Mail Merge in Word Using an Excel Spreadsheet
4835
Performing a Mail Merge is a great way to generate personalized letters or emails.
Merge Xlsx Files In R
There are three documents involved in the mail merge process:
- Easily combine Excel files with “ Magic Merge Manager “. The fifth way is probably most convenient: Press the Merge Files button on the “Home” ribbon in Excel. Now select all the files and worksheets you want to merge and the target workbook.
- Here is how to use it: Select the cells that you want to merge. Press Control + 1 to open the format cells dialogue box. In the Alignment tab, in the Horizontal drop-down, select Center Across Selection.
- Your main document
- Your data source
- Your merged document
NOTE: The examples shown below contain sample screen shots from Microsoft Word 2016. If you have a different version of Word, there may be some slight differences however, the same basic program flow should apply.
The Merge Cells tool works with all Excel versions from 2003 to 2016 and can combine all data types including text strings, numbers, dates and special symbols. Its two key advantages are simplicity and speed - any concatenation is done in a couple of clicks. On your Word document, highlight the field you want to populate with the data from Excel. On the Mailings tab, choose the ‘Insert Merge Field’ button, a list of the column headers on your saved excel document will drop down (i.e. Company Name, etc.). Choose the appropriate field you want to merge and choose Insert.
Step 1: Create your Excel Spreadsheet
The most important step in the mail merge process is to set up and prepare your data. You’ll use your Excel spreadsheet as the data source for your recipient list.
Here are some tips to prepare your data for a mail merge:
- Make sure the column names on your spreadsheet match the field names you want to insert in your mail merge
- All data to be merged is present in the first sheet of your spreadsheet
- All data entries with percentages, currencies, and zip codes are correctly formatted in the spreadsheet so that Word can properly read their values
- The Excel spreadsheet to be used in the mail merge is stored on your local computer
- Changes or additions to your spreadsheet are completed before it’s connected to your mail merge document in Word
Step 2: Create a mail merge document
When creating a mail merge you have the ability to use an existing document/letter.
In Word, open the existing file and press the ‘Mailings’ tab in the main menu.
On the Mailings tab, choose the ‘Start Mail Merge’ button, a list of different types of documents will drop down (i.e. Letters, E-mail Messages, etc.). choose the kind of merge you want to run.
Now choose the ‘Select Recipients’ button and choose ‘Use an Existing List’
Browse to find your Excel spreadsheet you previously saved, and then choose ‘OK’.
NOTE: Now the Excel spreadsheet is connected to the mail merge document you’re creating in Word.
Step 3: Inserting the merge fields
You will notice menu items are now active that were not previously
You can insert one or more mail merge fields that pull the information from your spreadsheet into your document.
On your Word document, highlight the field you want to populate with the data from Excel.
On the Mailings tab, choose the ‘Insert Merge Field’ button, a list of the column headers on your saved excel document will drop down (i.e. Company Name, etc.). Choose the appropriate field you want to merge and choose Insert.
The highlighted field will be replaced with the merge field (i.e. «Company», etc.)
Repeat step 3 for each of the fields you want to merge and choose Close when done.
Now choose ‘Save’.
Step 4: Previewing the mail merge
After you insert the merge fields you want you can now preview the results to confirm that the document is set-up the way you want.
On the Mailings tab, choose ‘Preview Results’. The merge fields will be populated with the data on the first row of your excel document.
To move through the records in your data source and view how they will appear in the document choose the right arrow to advance or the left arrow for the previous record.
Step 5: Merging and Saving your mail merge
On the Mailings tab, choose the ‘Finish & Merge’ button, a list of different types of merges will drop down (i.e. Edit Individual Documents, Print Documents and Send Email Messages) choose ‘Edit Individual Documents’. A ‘Merge to New Document’ pop-up box will appear, choose ‘OK’.
You will now have a separate letter for each of the rows on the excel document which you can print, email, etc.
Step 6: Saving your mail merge document
When you are done working with your merged documents, save and close it as you would any other Word document. Once closed the mail merge template will still be open. If you plan to reuse it in the future, save it and it will stay connected to your data source.
NOTE: A mail merge can just as easily be an email merge. Add a column to your excel spreadsheet that contains the email address to send each merged letter to. Under 'Finish and Merge', select 'Send Email Messages' and for the TO specify the column name that contains the email address and specify the SUBJECT to use.
Having your data spread across multiple Excel files? Want to merge Excel files into a single Excel Workbook? Today we going to explore just that – how to merge multiple Excel Workbook spreadsheets into a single Workbook. The obvious tool for this task is Visual Basic for Applications so let us jump right in.
Want to merge Worksheets or CSV files instead?:
Merge Excel files manually
Open the destination Workbook
Open the destination Excel Workbook (in our example Destination.xlsx) to which you want to copy the Worksheets of the remaining Workbooks (in our example Source.xlsx).
The further steps need to be repeated for each Excel Workbook you want to copy to the destination Workbook.
Open (each) the Workbook you want to merge and copy Worksheets
Open each Excel Workbook you want to merge with the destination Workbook.
Next right-click on each Worksheet you want to copy, click Move or Copy.... In the Move or Copy Window select the destination Workbook (Destination.xlsx in our case). Next:
- If you want to move (cut & paste) the Worksheet – simply click the OK button to proceed
- If you want to copy (copy & paste) the Worksheet – select the Create a Copy checkbox and click the OK button
Repeat Step 2 for each Workbook you want to copy to the destination Workbook.
Merge Excel files using VBA
Let us assume we have a couple of files listed in our directory (in my example these are File1 and File2.xlsx). What we want to do is create a new Excel Workbook and copy Worksheets to this new Workbook. I wanted however to account for 2 typical scenarios:
- Copy ALL worksheets
- Copy only a single worksheet – with a specific name
The code below supports both these scenarios.
Merge Excel files code
Use the MergeExcelFiles Sub procedure below to merge any number of Workbooks:
How to use the procedure above? Below I create a simple Test procedure that lists the Excel files within the Workbook directory and merges the Workbooks.
Pretty simple right?
Merge Excel files within a directory
The scenario above works pretty well for situations where we want to list explicitly files we want to merge into a single Excel Workbook. How about when we have tons of files? Or to make it more simple, if we want to merge all files within a SINGLE directory. As this is also a typical scenario I have modified the above Test procedure to accommodate just that:
How To Merge Data In Excel
What happens is that we use the VBA Dir function to loop through all files within a selected directory. As we go along we modify our VBA Array redefining its size and adding additional items.
Download the code
Want to download the code above and the example?
Merge Excel files in a whole directory structure
One last scenario that came to mind is when we have a whole directory structure (directories within other directories) containing files with want to merge. As the VBA Dir function works only for a single directory and does not traverse any directories within we would need to amend additionally the code above. If needed I recommend reading my post on How to traverse directories using the VBA Dir function.
Related posts: