Jezebel,
Your earlier response to my issue works perfectly by itself. But when I add
it to an IF statement, the macro completely runs over it bringing back a
negative response, therefore treating the line of code as if it had been
commented out.
Would you have any idea as to what the problem could be...
My code is...
If InStr(1, MyData, Chr(150)) > 0 Then
MyData = Replace$(OldData, Chr$(150), "-")
End If
*******************************************************
em-dash is chr(150)
BTW, the string versions of these functions are about 10 times faster than
the variant equivalents --
MyData = Replace$(OldData, chr$(150), "-")
"Vince" <sdsad@fsd.com> wrote in message
news:uU2pIoBCFHA.244@TK2MSFTNGP10.phx.gbl...
> myData=Replace(myData,chr(40),"-")
>
> OR
> myData=Replace(myData,"¾","-")
>
> Is this what you want?
>
> Vince
>
> "Eternally grateful" <Eternally grateful@discussions.microsoft.com> wrote
> in
> message news:1D3B6AAD-28BA-4C32-A474-A934B6C114E0@microsoft.com...
>> Can anyone tell me if it is possible to perform a search and replace
> inside
>> of a string?
>>
>> I have a string called myData that contains an emdash that I need to
> change
>> into a hyphen and I cannot find a way to do this.
>>
>> Any assistance would be greatly appreciated.
>>
>> Thank you for taking them time to read this.
>
>