View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Claus Busch Claus Busch is offline
external usenet poster
 
Posts: 3,872
Default Application.substitute

Hi Robert,

Am Sat, 28 Sep 2019 13:11:20 -0700 (PDT) schrieb RG III:

I'm able to read a text file into a variable. Now I want to do a search and replace of ALL instances of the word "bitch". Using Application.substitute() I'm able to replace the first occurrence of the target string, but I want to replace ALL occurrences with "#####".

How do you get Application.substitute() to search and replace multiple instances of a target string? Or is there a better method?


try:

myStr = Replace(myStr, "bitch", "####")


Regards
Claus B.
--
Windows10
Office 2016