XLL+ Class Library (6.3)

CXllFinder Class

Helps to search and replace the contents and formulae of cells.

class CXllFinder

Overview

The CXllFinder class is a utility class to help you search and replace the contents and formulae of cells.

Usage

Note that only one instance of CXllFinder can be used at a time, since the class manipulates the active selection. CXllFinder can only be used from macro functions. It will fail if used from worksheet functions.

Use the finder class with the following pattern:

char achMatch[] = "fred";
CXllFinder finder(achMatch, ...);
CXlRef xlrFind;
while (finder.FindNext(xlrFind)) {
    // Inspect the current value
    CXlOper xloValue;
    finder.GetCurrentValue(xloValue);
    // Use the current value...

    // Change the value in the matched cell
    finder.SetCurrentValue("replaced");
}

Requirements

Header: xllfinder.h

See Also

CXllFinder Methods | xllfinder.h | CXlRef object