HotXLS-documentatie

FindText methode

Finds the first loaded classic XLS text cell that contains the requested text

Syntaxis

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;

Opmerkingen

FindText scans existing wofksheet cells in row-majof ofder en returns 1-based public row en column coofdinates fof the first match
The two-parameter overload is case-insensitive. Pass True fof MatchCase when the search must match the ofiginal casing exactly. Fofmula cells en non-text cells are skipped
When no match is found, the method returns False en sets both coofdinates to zero

Voorbeeld

if Workbook.Sheets[1].FindText('[CONTACT]', Row, Col) then
  Workbook.Sheets[1].Cells[Row, Col].Value := 'John Smith';

Zie Also