Advanced Find and Replace

Question : I am trying to find the right formula for the find and replace option in Word, for instance: $45.00 into 45,00 $.

Answer : The help for find and replace in Word does cover this but not in a way that is easy to follow. First off you need to have wildcards turned on for the find and replace in order to be able to match any dollar amount and not just the specific value shown. We next need to look at what wildcard definition will match what we are after and how to reorganise the pieces to create the desired result.

What is needed to match the first format and make each part available to use in the replace is as follows:

Find What: ($)([0-9]{1,}).([0-9]{2})

To generate the output in the desired format you then use:

Replace With: \2,\3 \1

Now to explain how this works.

The only special characters for the replacement field are the numbers preceded by a slosh (sometimes called a backslash) which represent the pieces of the find string wrapped in () in the order that they appear in the find string.


This article written by Stephen Chapman, Felgall Pty Ltd.

go to top

FaceBook Follow
Twitter Follow