Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 65
Default Application.substitute

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?

-Robert
  #2   Report Post  
Posted to microsoft.public.excel.programming
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
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
=SUBSTITUTE(SUBSTITUTE(SUBSTITUTE.... max. limit 8 :( [email protected] Excel Discussion (Misc queries) 6 May 22nd 08 05:33 PM
Substitute mrbalaje Excel Discussion (Misc queries) 2 March 15th 07 07:47 AM
Replace vs Application.Substitute Ski Excel Programming 1 November 24th 06 05:58 AM
SUBSTITUTE Steved Excel Worksheet Functions 4 June 2nd 06 06:51 PM
using a substitute value Tracy D. Excel Programming 1 March 1st 05 07:41 PM


All times are GMT +1. The time now is 02:14 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"