Finds the first loaded classic XLS text cell that contains the requested text.
Syntax
function FindText(SearchText: WideString; out Row: Integer; out Col: Integer): Boolean; overload;
function FindText(SearchText: WideString; out Row: Integer; out Col: Integer; MatchCase: Boolean): Boolean; overload;
Remarks
FindText scans existing worksheet cells in row-major order and returns 1-based public row and column coordinates for the first match.
The two-parameter overload is case-insensitive. Pass True for MatchCase when the search must match the original casing exactly. Formula cells and non-text cells are skipped.
When no match is found, the method returns False and sets both coordinates to zero.
Example
if Workbook.Sheets[1].FindText('[CONTACT]', Row, Col) then
Workbook.Sheets[1].Cells[Row, Col].Value := 'John Smith';
See Also