Redigera

Dela via


Replace dialog box

Searches code in a project for specified text and replaces it with the new text specified.

The following table describes the dialog box options.

Option Description
Find What Type or insert the information you want to find, or click the down arrow and select from the last four entries. If any text is selected or the cursor is on a word when you choose the command, this text is displayed in the Find What box.
Replace With Type the text you want to use as the replacement text or paste it from the Clipboard. To delete the text in the Find What box from the document, leave the Replace With box empty.
Search Specifies the search range.

- Current Procedure: Searches only the current procedure.
- Current Module: Searches only the current module.
- Current Project: Searches all the modules in your project.
- Selected Text: Searches a selected range of code in your project.
Direction Sets the direction of the search to Down, Up, or All in the selected search range.
Find Whole Word Only Searches for the full word by itself and not as part of a larger word.
Match Case Finds all occurrences with the exact combination of uppercase and lowercase letters specified in the Find What box.
Use Pattern Matching Searches by using pattern-matching characters.
Find Next Finds and selects the next occurrence of the text specified in the Find What box.
Cancel Closes the dialog box without replacing text.
Replace Confirms before replacing the search text with the replacement text.
Replace All Replaces all occurrences of the search text with the replacement text without stopping for confirmation.

See also

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.