Changing 77 777 to 77,777

  • Thread starter Thread starter Brian
  • Start date Start date
B

Brian

I have a document in Word 2000 which contains a lot of numbers in the text
(ie not in tables).

The document was written by someone who uses a space as the thousands
separator, instead of a comma. So, for example whereas I would write
"77,777.77", he writes "77 777.77".

This is a problem for various reasons, including that the number can break
across the end of a line. Is there a way of replacing these spaces with
commas globally? I have looked at Search & Replace, but there seems to be no
special character to mean "any single digit".
 
Brian,

Replace>More>Use Wildcards
Find:
([0-9]) ([0-9]{3}[,.])
Replace with
\1\,\2

should work.
 
Brian,

Change the comma in the find string I posted to a space. You may have to
run the routine twice to pick up and format large numbers.
 
Greg,

Thanks for your reply. When I try this, I get the message "The Replace With
text contains a group number which is out of range".

Brian
 
Greg,

Word is making 0 replacements with this. I have copied the find and replace
strings I typed here:

([0-9]) ([0-9]{3}[ .])

\1,\2



and I'm using it on this file:



77 777.77



77,777.77



I also tried it on the original problem file, with no replacements made.



Brian
 
Brian,

I just copied the find and replace strings that you posted here and
texted with with 77 777.00 and it worked fine.

Do you have Replace>More>Search>All selected?

Try with your cursor at the start of the document.

You might also try wiping any bad karma from the dialog boxes with:

http://word.mvps.org/FAQs/MacrosVBA/ClearFind.htm
 
Back
Top