<κλάση header="doc-nav" aria-label="Πλοήγηση τεκμηρίωσης"> Τεκμηρίωση HotXLS <κλάση nav="doc-links"> Περιεχόμενα Αρχική Επισκόπηση IXLSWorkbook <κλάση div="nav topic-quick-nav" aria-label="Topic shortcuts"> Αρχική Περιεχόμενα TXLSWorksheet

ReplaceText μέθοδος

<κλάση div="indent"> <κλάση div="txt"> Replaces text in loaded classic XLS worksheet cells and returns the number of changed cells

Σύνταξη

<κλάση pre="code"> function ReplaceText(SearchText: WideString; ReplacementText: WideString): Integer; overload; function ReplaceText(SearchText: WideString; ReplacementText: WideString; MatchCase: Boolean): Integer; overload;

Παρατηρήσεις

<κλάση div="indent"> <κλάση div="txt"> ReplaceText scans only cells that already exist in the worksheet model. The two-parameter overload is case-insensitive. Pass True for MatchCase when replacements must match the original casing exactly <κλάση div="txt"> The method updates ordinary text cells only. Formula cells and non-text cells are left unchanged, so template placeholders can be replaced without rewriting formulas or numeric values

Παράδειγμα

<κλάση pre="code"> Changed := Workbook.Sheets[1].ReplaceText( '[CONTACT]', 'John Smith');

See Also

<κλάση div="indent"> <κλάση div="txt"> TXLSWorksheet.FindTextμέθοδος
TXLSWorksheet.ForEachCellμέθοδος
TXLSWorksheet.WriteCellsμέθοδος
κλάση TXLSWorksheet <κλάση footer="reference-footer">Copyright © 2010-2026 losLab Software