Hi Nora,
"Run-time error 5560 The find What test contains
a Pattern Match expression which is not valid".
that is due to localization, which I abhor.
"[0-9]{3,}" works with US-English.
"[0-9]{3;}" works at least with German and Dutch.
Documentation on differences between localization is hard to find.
MsgBox Application.International(wdListSeparator) might tell you,
what your listseperator is.
Excluding dates from being reformatted, depends on the date format,
wich <gr> depens on localization again.
You may check, whether the found string contains a seperator such as
"/" or "." and exclude it from reformatting, like this:
Sub test113()
Dim sNmb As String
Dim oRng As Range
Set oRng = ActiveDocument.Range
Resetsearch
With oRng.Find
.Text = "[0-9]{3,}"
.MatchWildcards = True
While .Execute
sNmb = oRng.Text
if (instr(sNmb, "/") = 0) and (instr(sNmb, ".") = 0) then ' !!!
sNmb = Format(sNmb, "#,#")
oRng.Text = sNmb
endif
oRng.Start = oRng.End
oRng.End = ActiveDocument.Range.End
Wend
End With
Resetsearch
End Sub
---
Greetings from Bavaria, Germany
Helmut Weber, MVP
"red.sys" & chr(64) & "t-online.de"
Word XP, Win 98