WorksheetFunction.ReplaceB (Excel)
Replaces part of a text string, based on the number of bytes that you specify, with a different text string.
Replace is intended for use with languages that use the single-byte character set (SBCS), whereas ReplaceB is intended for use with languages that use the double-byte character set (DBCS). The default language setting on your computer affects the return value in the following way:
ReplaceB (Arg1, Arg2, ..., Arg4)
Dim strArg1 As String: strArg1 =
Dim dblArg2 As Double: dblArg2 =
Dim dblArg3 As Double: dblArg3 =
Dim strArg4 As String: strArg4 =
Dim strReplaceB As String
strReplaceB = WorksheetFunction.ReplaceB(Arg1:=strArg1, Arg2:=dblArg2, Arg3:=dblArg3, Arg4:=strArg4)
Arguments
Arg1, Arg2, ..., Arg4Arg1 (String) - Old_text - text in which you want to replace some characters.
Arg2 (Double) - Start_num - the position of the character in old_text that you want to replace with new_text.
Arg3 (Double) - Num_chars - the number of characters in old_text that you want Replace to replace with new_text.
Arg4 (String) - New_text - the text that will replace characters in old_text.