Table of Contents

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

text string

The text to find.

options XlsxFindOptions

How 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

text is null.

ArgumentException

text is empty.

InvalidDocumentException

The sheet's part is malformed.