Posted to microsoft.public.excel.programming
|
|
How to Find&Replace with MatchWholeWord?
Certainly not a general workaround. Doesn't account for punctuation or
position.
--
Regards,
Tom Ogilvy
"Anthony D" wrote in message
...
Hi Tom,
Perhaps a workaround in this case might be (?)
What:=" the "
Anthony
"Tom Ogilvy" wrote:
in code, in the find statement change
LookAt:=xlPart
to
LookAt:=xlWhole
but this is for the whole value of a cell. There isn't an option that
would
correctly interpret
What:="the"
With:="pig"
to ignore "Look there, John, see, the is pink"
xlWhole would ignore the string
xlPart would do "Look pigre, John, see, pig is pink"
Think you would be left with programming your own solution using regular
expressions or build your own parser.
--
Regards,
Tom Ogilvy
"JS" wrote in message
...
Hi All:
I need to Find and Replace text in excel, however I'm bumping into a
problem: parts of longer words are being found by shorter words and
these
parts are being then replace with the ReplaceWith text.
Word's VBA has the "MatchWholeWord Property" that avoids this problem.
Does anyone know if there is a way to do this "MatchWholeWord" in Excel
VBA?
Thanks for your help, JS
|