Method FindText
- Namespace
- DocWright.Spreadsheet
- Assembly
- DocWright.Spreadsheet.dll
FindText(string, XlsxFindOptions?)
Finds every occurrence of a text in the sheet's cells.
public IReadOnlyList<XlsxCellMatch> FindText(string text, XlsxFindOptions? options = null)
Parameters
textstringThe text to find.
optionsXlsxFindOptionsHow to match, or null for the defaults (case-sensitive, anywhere in a cell, values).
Returns
- IReadOnlyList<XlsxCellMatch>
The matches, in sheet order and then in the order they stand in the cell.
Remarks
Every cell is searched by what it shows: text as it is, and a number, a date, a boolean or an error by the text Excel displays for it (DisplayText), which is what Excel's own Find looks at in values; SearchNumbers turns that off. A formula cell is searched by what it results in (or by its formula, with Formulas).
Exceptions
- ArgumentNullException
textis null.- ArgumentException
textis empty.- InvalidDocumentException
The sheet's part is malformed.