XLL+ Class Library (6.3)

CXlMacros::FormulaReplace

Finds and replaces characters in cells on your worksheet

static int FormulaReplace(
   LPCTSTR find_text,
   LPCTSTR replace_text,
   bool look_at_entire_cell,
   bool look_by_rows = true,
   bool active_cell_only = true,
   bool match_case = false
);

Parameters

find_text

Find_text is the text you want to find.

replace_text

Replace_text is the text you want to replace find_text with.

look_at_entire_cell

If true, looks for find_text as the entire contents of a cell. If false, looks for find_text as part of the contents of a cell.

look_by_rows

If true, looks for find_text by rows. If false, looks for find_text by columns.

active_cell_only

If active_cell_only is true, find_text is replaced in the active cell only. If active_cell is false, find_text is replaced in the entire selection, or, if the selection is a single cell, in the entire sheet.

match_case

Match_case is a logical value corresponding to the Match Case check box in the Replace dialog box.

Return Value

Zero if the function has been called successfully; non-zero if the function could not be called. See Error codes for a list of return values.

Remarks

See the Microsoft Excel on-line Help for full details about this function.

Requirements

Header: xlfuncs.h

See Also

CXlMacros Class | CXlMacros Methods