Suzanne has an Excel worksheet containing addresses. The ZIP Codes are formatted via the special Excel formatting that maintains leading zeroes. However, when she uses mail merge in Word, the leading zeroes are dropped.
There are several ways you can approach this problem. You could, for instance, go into Excel and create a new column that contains text versions of the numeric ZIP Codes. Here's a handy Excel formula to use to accomplish this:
=RIGHT("00000" & A1, 5)
If you put this formula in a column that has been formatted as text (and the ZIP Code is in cell A1), you end up with text that contains the leading zeroes. You can then use this new column in your merge in Word.
If you don't want to edit the original Excel data, then you should stick with making your changes in the Word merge document. Take a look at the document; it contains merge fields that indicate where the merged data will be placed. These fields also indicate how the merged data should be treated. If you select the merge field for the ZIP Code, you can expand it by pressing Shift+F9. You should see the underlying code that makes up the field. You can then modify the field code so it looks similar to this:
{ MERGEFIELD "Zip" \# 00000-0000 }
The name within the quote marks ("Zip") may well be different; it represents the name of the column in the Excel worksheet that needs to be merged. The important part is to add the formatting switch (\#) followed by the pattern to be used for formatting the merged data. When you are done making the change to the field, you can press Shift+F9 again to collapse the field, and then do your merge.
WordTips is your source for cost-effective Microsoft Word training. (Microsoft Word is the most popular word processing software in the world.) This tip (9195) applies to Microsoft Word 2007, 2010, 2013, 2016, 2019, and Word in Office 365. You can find a version of this tip for the older menu interface of Word here: Maintaining Leading Zeroes.
Create Custom Apps with VBA! Discover how to extend the capabilities of Office 2013 (Word, Excel, PowerPoint, Outlook, and Access) with VBA programming, using it for writing macros, automating Office applications, and creating custom applications. Check out Mastering VBA for Office 2013 today!
When you merge information with a Word document, you may not be completely satisfied with the appearance of some of the ...
Discover MoreWhen you use an Excel workbook as a data source for your merged document, you may be surprised if what is merged doesn't ...
Discover MoreUsing the mail merge feature of Word, you can make data from Access databases accessible for your documents. How ...
Discover MoreFREE SERVICE: Get tips like this every week in WordTips, a free productivity newsletter. Enter your address and click "Subscribe."
2021-10-06 11:09:31
Gale S Hart
Thank you for the guidance! Admin is out sick and I could not get the mailmerge with zip. I got the zip code to work with your formula without the plus 4. When I added that it put the 0000 before the zip and without the leading 0.
Any help would be greatly appreciated!
Thank you.
2020-06-16 10:18:55
R French
Thank You! Time was short and you saved my letters!!!!!!!!!!
2020-03-16 17:06:35
Gail
I tried the Shift+F9 to expand the zipcode merge field in question, but I only get a pop up box, not the expanded underlying code. (see Figure 1 below)
Figure 1. pop up box
2015-04-26 18:35:57
Ingrid Kennedy
Here is a quick way to do this, Allan. Type a single quotation mark before the zero. You will have to realign it as it is now seen as text, but the single quotation mark won't show up in the cell.
2015-04-25 09:36:07
awyatt
Thanks for catching that, Micky. Not sure how that got through (must have been asleep when I wrote that line).
Anyway, I changed it in the tip. Thanks, again.
-Allen
2015-04-25 04:50:58
Michael (Micky) Avidan
@Allan,
Is it only my imagination or you have a special & secret relationship, with MS, who enabled your Excel to use: RTRIM in a formula(!) ?
Michael (Micky) Avidan
“Microsoft® Answers" - Wiki author & Forums Moderator
“Microsoft®” MVP – Excel (2009-2015)
ISRAEL
Got a version of Word that uses the ribbon interface (Word 2007 or later)? This site is for you! If you use an earlier version of Word, visit our WordTips site focusing on the menu interface.
Visit the WordTips channel on YouTube
FREE SERVICE: Get tips like this every week in WordTips, a free productivity newsletter. Enter your address and click "Subscribe."
Copyright © 2022 Sharon Parq Associates, Inc.
Comments