SUBSTITUTE is the cell formula function of Excel, not the internal function of VBA. These two concepts must be clearly distinguished. Although there are many functions with the same name and similar usage, they are essentially different!
The following is the usage of the SUBSTITUTE function in Excel:
If you need to replace the specified text in a text string, you can Use the function SUBSTITUTE.
Syntax
SUBSTITUTE(text,old_text,new_text,[instance_num])
Parameters
Text is the text in which the characters need to be replaced, or contains text The cell reference of The number of occurrences of old_text; if instance_num is specified, only old_text that meets the requirements will be replaced; if it is defaulted, all old_text that appears in TEXT will be replaced with new_text.
ExampleIf A1=the revolution of learning, A2=computer
Then the formula=SUBSTITUTE(A1,"the revolution",A2,1 )Return to "Learning Computers"
To view all available functions in Excel, you can click the "fx" icon on the left side of the Excel edit bar, which contains descriptions of all functions.
To view all available functions in VBA, you can click the Help menu in the VB window. The language reference inside contains detailed descriptions of all VBA functions, statements, properties, methods, objects, etc.
For more Excel-related technical articles, please visit the
Excel Basic Tutorialcolumn to learn!
The above is the detailed content of substitute function usage. For more information, please follow other related articles on the PHP Chinese website!