Replace function

Category: String / Text

Summary

Replace substring.

Syntax

Replace(expression, find, replace, [ start, [ count, [ compare ]]]) The Replace function syntax has these named arguments:
Part
Description
expressionRequired. String expression containing substring to replace.
findRequired. Substring being searched for.
replaceRequired. Replacement substring.
startOptional. Start position for the substring of expression to be searched and returned. If omitted, 1 is assumed.
countOptional. Number of substring substitutions to perform. If omitted, the default value is -1, which means, make all possible substitutions.
compareOptional. Numeric value indicating the kind of comparison to use when evaluating substrings. See Settings section for values.

Microsoft Support Page

https://learn.microsoft.com/en-us/office/vba/language/reference/user-interface-help/replace-function

Back to Functions