Hello,
How Can I Use the --Replace-- function to replace whole word (instead or partial)
The result of the above sub is:Sub TestFindReplace() strToReplace = "Range(""Sh01Start""), Range(""Sh01StartEnd"")" strAfterReplace = Replace(strToReplace, "Sh01Start", "Sh01End", Start:=1, Count:=-1, compare:=vbBinaryCompare) Debug.Print strAfterReplace End Sub
Expected Result With Whole Word Replacement isRange("Sh01End"), Range("Sh01EndEnd")
Thank you.Range("Sh01End"), Range("Sh01StartEnd")
Bookmarks