Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 02-10-2025, 12:40 PM
dragonfly dragonfly is offline Using a macro to find and replace merge fields? Windows 10 Using a macro to find and replace merge fields? Office 2016
Novice
Using a macro to find and replace merge fields?
 
Join Date: Feb 2025
Posts: 2
dragonfly is on a distinguished road
Default Using a macro to find and replace merge fields?

I am trying to replace {MERGEFIELD Address_3} and {MERGEFIELD "Postal"} with {MERGEFIELD City_state_zip}



Can anyone help me with this?
Reply With Quote
  #2  
Old 02-10-2025, 01:39 PM
macropod's Avatar
macropod macropod is offline Using a macro to find and replace merge fields? Windows 10 Using a macro to find and replace merge fields? Office 2016
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,467
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

You don't need a macro for that. All you need is Find/Replace!

Ordinarily the field codes for those would look like:
{ MERGEFIELD Address_3 } and { MERGEFIELD "Postal" }
with a single space character before 'MERGEFIELD'. Assuming that is the case, use Alt-F9 to display the field codes, then do a Find/Replace for
Find = Address_3
Replace = City_state_zip
Find = ^d MERGEFIELD "Postal"
Replace = nothing
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #3  
Old 02-11-2025, 07:27 AM
dragonfly dragonfly is offline Using a macro to find and replace merge fields? Windows 10 Using a macro to find and replace merge fields? Office 2016
Novice
Using a macro to find and replace merge fields?
 
Join Date: Feb 2025
Posts: 2
dragonfly is on a distinguished road
Default

Thank you! I feel like quite the idiot, because it is so simple.
Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
VBA to find/replace in LINK fields (linked Excel objects) with use of text boxes Nana Word VBA 0 03-08-2023 06:24 AM
Using a macro to find and replace merge fields? Can I use Find and Replace in form fields? wardw Word 4 12-02-2021 08:15 PM
Macro to keep formatted form fields after mail merge or replace text with formatted form fields jer85 Word VBA 2 04-05-2015 10:00 PM
macro or find/replace JamesVenhaus Word 2 02-27-2012 03:34 PM
Find and Replace Macro - A Better Way Tribos Word VBA 0 10-08-2008 03:22 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 02:37 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft