Bewerken

Delen via


AutoCorrect.AddReplacement method (Excel)

Adds an entry to the array of AutoCorrect replacements.

Syntax

expression.AddReplacement (What, Replacement)

expression A variable that represents an AutoCorrect object.

Parameters

Name Required/Optional Data type Description
What Required String The text to be replaced. If this string already exists in the array of AutoCorrect replacements, the existing substitute text is replaced by the new text.
Replacement Required String The replacement text.

Return value

Variant

Example

This example substitutes the word Temp. for the word Temperature in the array of AutoCorrect replacements.

With Application.AutoCorrect 
 .AddReplacement "Temperature", "Temp." 
End With

Support and feedback

Have questions or feedback about Office VBA or this documentation? Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.