WorksheetFunction.Replace (Excel)
Replaces part of a text string, based on the number of characters that you specify, with a different text string.
Replace (Arg1, Arg2, ..., Arg4)
Dim strArg1 As String: strArg1 =
Dim dblArg2 As Double: dblArg2 =
Dim dblArg3 As Double: dblArg3 =
Dim strArg4 As String: strArg4 =
Dim strReplaced As String
strReplaced = WorksheetFunction.Replace(Arg1:=strArg1, Arg2:=dblArg2, Arg3:=dblArg3, Arg4:=strArg4)
Arguments
Arg1, Arg2, ..., Arg4Arg1 (String) - Text in which you want to replace some characters.
Arg2 (Double) - The position of the character in Arg1 that you want to replace with Arg4.
Arg3 (Double) - The number of characters in Arg1 that you want the Replace method to replace with Arg4.
Arg4 (String) - Text that will replace characters in Arg1.