GetCells

IExcelDataWorkbook.GetCells method

Retrieves a collection of cells from the workbook that match the specified formula.

public ReadOnlyCollection<IExcelDataCell> GetCells(string formula, bool skipHiddenCells)
ParameterTypeDescription
formulaStringA formula or range expression (e.g., “Sheet1!A1:B3”) used to identify target cells.
skipHiddenCellsBooleanIf true, hidden cells (e.g., in hidden rows or columns) will be excluded from the result.

Return Value

A read-only list of cells that match the specified formula.

Examples

Example:

[C#]
ExcelDataWorkbook wb = new ExcelDataWorkbook(testFile);
IReadOnlyList<IExcelDataCell> cells = wb.GetCells("Sheet1!A2:A6", false);
Console.WriteLine(cells.Count); //Output: 5

See Also