WorksheetFunction.Replace Method
Excel Developer Reference |
Replaces part of a text string, based on the number of characters you specify, with a different text string.
Syntax
expression.Replace(Arg1, Arg2, Arg3, Arg4)
expression A variable that represents a WorksheetFunction object.
Parameters
Name | Required/Optional | Data Type | Description |
---|---|---|---|
Arg1 | Required | String | Text in which you want to replace some characters. |
Arg2 | Required | Double | The position of the character in Arg1 that you want to replace with Arg4. |
Arg3 | Required | Double | The number of characters in Arg1 that you want the Replace method to replace with Arg4. |
Arg4 | Required | String | Text that will replace characters in Arg1. |
Return Value
A String value that represents the new string, after replacement.
Example
This example replaces abcdef with ac-ef and notifies the user during this process.
Visual Basic for Applications |
---|
|
See Also