FORMULA.REPLACE macro

Equivalent to clicking the Replace command on the Edit menu. Finds and replaces characters in cells on your worksheet.

Syntax

FORMULA.REPLACE(find_text, replace_text, look_at, look_by, active_cell, match_case)

FORMULA.REPLACE?(find_text, replace_text, look_at, look_by, active_cell, match_case)

Find_text    is the text you want to find. You can use the wildcard characters, question mark (?) and asterisk (*), in find_text. A question mark matches any single character; an asterisk matches any sequence of characters. If you want to find an actual question mark or asterisk, type a tilde (~) before the character.

Replace_text    is the text you want to replace find_text with.

Look_at    is a number specifying whether you want find_text to match the entire contents of a cell or any string of matching characters.

Look_at Looks for find_text
1 or omitted As the entire contents of a cell
2 As part of the contents of a cell

Look_by    is a number specifying whether to search horizontally (through rows) or vertically (through columns).

Look_by Looks for find_text
1 or omitted By rows
2 By columns

Active_cell    is a logical value specifying the cells in which find_text is to be replaced.

 

Match_case    is a logical value corresponding to the Match Case check box in the Replace dialog box. If match_case is TRUE, Microsoft Excel selects the check box; if FALSE, Microsoft Excel clears the check box. If match_case is omitted, the status of the check box is unchanged.

Remarks

 

Related Function

FORMULA.FIND   Finds text in a workbook

Return to index