Table of Contents

Interface IXLRanges

Namespace
SlapKit.Excel.Excel
Assembly
SlapKit.Excel.dll
public interface IXLRanges : IEnumerable<IXLRange>, IEnumerable
Inherited Members
Extension Methods

Properties

Count

int Count { get; }

Property Value

int

Style

IXLStyle Style { get; set; }

Property Value

IXLStyle

Value

Sets the cells' value.

Setter will clear a formula, if the cell contains a formula. If the value is a text that starts with a single quote, setter will prefix the value with a single quote through IncludeQuotePrefix in Excel too and the value of cell is set to to non-quoted text.

XLCellValue Value { set; }

Property Value

XLCellValue

Methods

Add(IXLCell)

void Add(IXLCell range)

Parameters

range IXLCell

Add(IXLRangeBase)

Adds the specified range to this group.

void Add(IXLRangeBase range)

Parameters

range IXLRangeBase

The range to add to this group.

AddToNamed(string)

Creates a named range out of these ranges.

If the named range exists, it will add these ranges to that named range.

The default scope for the named range is Workbook.

IXLRanges AddToNamed(string rangeName)

Parameters

rangeName string

Name of the range.

Returns

IXLRanges

AddToNamed(string, XLScope)

Creates a named range out of these ranges.

If the named range exists, it will add these ranges to that named range.

Name of the range. The scope for the named range.
IXLRanges AddToNamed(string rangeName, XLScope scope)

Parameters

rangeName string
scope XLScope

Returns

IXLRanges

AddToNamed(string, XLScope, string)

Creates a named range out of these ranges.

If the named range exists, it will add these ranges to that named range.

Name of the range. The scope for the named range. The comments for the named range.
IXLRanges AddToNamed(string rangeName, XLScope scope, string comment)

Parameters

rangeName string
scope XLScope
comment string

Returns

IXLRanges

Cells()

Returns the collection of cells.

IXLCells Cells()

Returns

IXLCells

CellsUsed()

Returns the collection of cells that have a value.

IXLCells CellsUsed()

Returns

IXLCells

CellsUsed(XLCellsUsedOptions)

Returns the collection of cells that have a value.

IXLCells CellsUsed(XLCellsUsedOptions options)

Parameters

options XLCellsUsedOptions

The options to determine whether a cell is used.

Returns

IXLCells

Clear(XLClearOptions)

Clears the contents of these ranges.

IXLRanges Clear(XLClearOptions clearOptions = XLClearOptions.All)

Parameters

clearOptions XLClearOptions

Specify what you want to clear.

Returns

IXLRanges

Consolidate()

Create a new collection of ranges which are consolidated version of source ranges.

IXLRanges Consolidate()

Returns

IXLRanges

Contains(IXLRange)

bool Contains(IXLRange range)

Parameters

range IXLRange

Returns

bool

CreateDataValidation()

Creates a new data validation rule for the ranges collection, replacing the existing ones.

IXLDataValidation CreateDataValidation()

Returns

IXLDataValidation

GetIntersectedRanges(IXLAddress)

Filter ranges from a collection that intersect the specified address. Is much more efficient that using Linq expression .Where().

IEnumerable<IXLRange> GetIntersectedRanges(IXLAddress address)

Parameters

address IXLAddress

Returns

IEnumerable<IXLRange>

GetIntersectedRanges(IXLCell)

Filter ranges from a collection that intersect the specified cell. Is much more efficient that using Linq expression .Where().

IEnumerable<IXLRange> GetIntersectedRanges(IXLCell cell)

Parameters

cell IXLCell

Returns

IEnumerable<IXLRange>

GetIntersectedRanges(IXLRangeAddress)

Filter ranges from a collection that intersect the specified address. Is much more efficient that using Linq expression .Where().

IEnumerable<IXLRange> GetIntersectedRanges(IXLRangeAddress rangeAddress)

Parameters

rangeAddress IXLRangeAddress

Returns

IEnumerable<IXLRange>

Remove(IXLRange)

Removes the specified range from this group.

bool Remove(IXLRange range)

Parameters

range IXLRange

The range to remove from this group.

Returns

bool

RemoveAll(Predicate<IXLRange>?, bool)

Removes ranges matching the criteria from the collection, optionally releasing their event handlers.

void RemoveAll(Predicate<IXLRange>? match = null, bool releaseEventHandlers = true)

Parameters

match Predicate<IXLRange>

Criteria to filter ranges. Only those ranges that satisfy the criteria will be removed. Null means the entire collection should be cleared.

releaseEventHandlers bool

Specify whether or not should removed ranges be unsubscribed from row/column shifting events. Until ranges are unsubscribed they cannot be collected by GC.

Select()

void Select()

SetDataValidation()

[Obsolete("Use CreateDataValidation() instead.")]
IXLDataValidation SetDataValidation()

Returns

IXLDataValidation

SetValue(XLCellValue)

IXLRanges SetValue(XLCellValue value)

Parameters

value XLCellValue

Returns

IXLRanges