-
-
Save ndthanh/015198bd57d2fa278fb0df033d72b844 to your computer and use it in GitHub Desktop.
VBA: replace last occurrence of a string within a string
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
' replace only the LAST occurrence of a the SEARCH substring in SOURCE | |
' with the REPLACESTR string - search isn't case-sensitive | |
ReplaceLast = StrReverse(Replace(StrReverse(Source), StrReverse(Search), StrReverse(ReplaceStr), , 1)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment