Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Replace Command (Edit Menu)
Collapse the table of content
Expand the table of content

Replace Command (Edit Menu)

This page is specific to the Visual Basic for Applications (VBA) Language Reference for Office 2010.

Searches code in the project for the specified text and replaces it with the new text specified in the Replace dialog box.

Toolbar shortcut: Gg278480.tbr_repl_ZA01201735(en-us,office.14).gif. Keyboard shortcut: CTRL+H.

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.


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.


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 using pattern-matching characters.

Find Next

Finds and selects the next occurrence of the text specified in the Find What box.


Closes the dialog box without replacing text.


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.

© 2015 Microsoft