VBA & Macro Problems

Replace Multiple Mail Merge Fields with One Field in Word

Nimra MalikNimra Malik Nov 20, 2026 868 views

Question details

Replace the Pref_City, Pref_State, and Pref_Zip mail merge fields with a single CityStZip field.

Replace Multiple Mail Merge Fields with One Field in Word
Product
Microsoft Word
Device & OS
not provided
Scenario
A Word mail merge document uses three individual fields for a city, state, and ZIP code, and the user wants to insert one combined field instead.
Observed behavior
The desired result is one CityStZip merge field that displays the combined address components.
Before you start

Check that you can edit the mail merge data source and that its city, state, and ZIP columns contain the intended values. If ZIP codes have leading zeros, store them as text before combining them.

Solution 1Recommended

Add a combined field to the data source and insert it in Word

Use this approach to replace the three fields without writing a macro.

1
Create the combined column

In the data source, add a column named CityStZip. For example, in an Excel table, enter =[@Pref_City]&", "&[@Pref_State]&" "&[@Pref_Zip] and fill it down if needed.

2
Save and reconnect the source

Save the data source. In Word, open Mailings > Select Recipients > Use an Existing List and select the updated source if CityStZip is not available in the field list.

3
Replace the existing fields

In the document, select the three merge fields and any separators between them. Delete the selection, then choose Mailings > Insert Merge Field > CityStZip. Repeat at other locations where the fields appear together.

4
Preview the result

Choose Mailings > Preview Results and browse several recipients to check the punctuation, spacing, and ZIP codes.

Add a combined field to the data source and insert it in Word
Check incomplete addresses: The example formula always adds a comma and space. Adjust it if some records have blank city, state, or ZIP values.
Free Microsoft Office alternative

Work with mail merge documents in WPS Office

WPS Office is a free, lightweight alternative with a familiar interface for working with documents and spreadsheets. Its Microsoft Office format support helps you move existing files between suites; it does not fix Word-specific VBA behavior.

Work with Word documents and Excel data sources in one office suiteCompatible with Microsoft Word DOCX and Excel XLSX formatsFamiliar editing interface for a smoother transitionFree and lightweight for everyday office tasks
microsoft office alternative - wps office

Frequently Asked Questions

Why doesn't CityStZip appear in Insert Merge Field?

Confirm that CityStZip is a column header in the saved data source. If it still does not appear, reconnect the file through Mailings > Select Recipients > Use an Existing List.

Will the macro replace every group of fields in the document?

No. The macro replaces the current selection only. Select each group of fields and its separators, then run the macro again.

How can I keep leading zeros in ZIP codes?

Store ZIP codes as text in the data source before creating CityStZip. Then use Mailings > Preview Results in Word to check the merged values.

Can I use AutoText instead of a combined data field?

Yes. You can store an AutoText entry containing the three merge fields and their formatting in a template accessible to your macro. This reuses the group but does not turn it into a single CityStZip field.