Maybe a macro like this (where the OP would select all the cells he wanted
to do the replacement on before running it)...
Sub TextFilter()
Dim RegEx As Object, Cell As Range
Set RegEx = CreateObject("VBScript.RegExp")
RegEx.Global = True
RegEx.IgnoreCase = True
RegEx.Pattern = "\bTEST\b"
For Each Cell In Selection
Cell.Value = WorksheetFunction.Trim(RegEx.Replace(Cell.Value, ""))
Next
End Sub
--
Rick (MVP - Excel)
"Rick Rothstein" wrote in message
...
That won't necessarily work all the time. Consider text strings like the
following...
"Consider this location for TEST, it won't be replaced."
"This text (with the word TEST) won't work either."
"Do you think the replacement will happen here for TEXT?"
and so on...
I think a VB macro, probably using Regular Expressions, will be necessary
to handle this.
--
Rick (MVP - Excel)
"bill kuunders" wrote in message
...
On Oct 21, 8:46 am, John Calder
wrote:
Hi
I run Excel 2K
I have a number of text strings with each string containing a key word
which
is located in different postitions of each text string.
I need a formula that extracts only that key word from the text string.
Lets say the word is TEST
Thanks
I assume you want to keep the rest
One way
Use "edit" "replace...."
In the find you enter <spaceTEST<space
in the replace you enter nothing
If the word happens to be right at the end or beginning of the text
string you have to do it again without the space at the end or start
of the "find what" entry.
Greetings from NZ