Table of Contents

Class RangesCollection

Namespace
Spire.Xls.Collections
Assembly
Spire.XLS.dll
public class RangesCollection : XlsRangesCollection, IList<IXLSRange>, ICollection<IXLSRange>, ICloneParent, IEnumerable<IXLSRange>, IXLSRanges, ICombinedRange, IXLSRange, IExcelApplication, IEnumerable
Inheritance
RangesCollection
Implements
Inherited Members

Properties

Borders

Returns a Borders collection that represents the borders of a style or a range of cells (including a range defined as part of a conditional format).

public BordersCollection Borders { get; }

Property Value

BordersCollection

Cells

Returns a Range object that represents the cells in the specified range.

public CellRange[] Cells { get; }

Property Value

CellRange[]

Columns

Returns a Range object that represents the columns in the specified range

public CellRange[] Columns { get; }

Property Value

CellRange[]

Comment

Returns a Comment object that represents the comment associated with the cell in the upper-left corner of the range.

public ExcelComment Comment { get; }

Property Value

ExcelComment

EndCell

Returns a Range object that represents the cell at the end of the region that contains the source range.

public CellRange EndCell { get; }

Property Value

CellRange

EntireColumn

Returns a Range object that represents the entire column (or columns) that contains the specified range.

public RangesCollection EntireColumn { get; }

Property Value

RangesCollection

EntireRow

Returns a Range object that represents the entire row (or rows) that contains the specified range.

public RangesCollection EntireRow { get; }

Property Value

RangesCollection

MergeArea

Returns a Range object that represents the merged range containing the specified cell.

public RangesCollection MergeArea { get; }

Property Value

RangesCollection

RichText

Returns a RichTextString object that represents the rich text style.

public RichText RichText { get; }

Property Value

RichText

Rows

Returns the number of the first row of the first area in the range.

public CellRange[] Rows { get; }

Property Value

CellRange[]

Style

Returns a Style object that represents the style of the specified range

public CellStyle Style { get; set; }

Property Value

CellStyle

Worksheet

public Worksheet Worksheet { get; }

Property Value

Worksheet

Methods

Add(CellRange)

Adds a range to the collection.

public void Add(CellRange range)

Parameters

range CellRange

Range to add.

AddComment()

Adds a comment to the range.

public ExcelComment AddComment()

Returns

ExcelComment

Added comment.

AddRange(CellRange)

Adds a range to the collection.

public void AddRange(CellRange range)

Parameters

range CellRange

Range to add.

Copy(CellRange)

Copies the range to the specified range.

public CellRange Copy(CellRange destRange)

Parameters

destRange CellRange

Destination range

Returns

CellRange

Destination range

Copy(CellRange, bool)

Copies the range to the specified range.

public CellRange Copy(CellRange destRange, bool updateReference)

Parameters

destRange CellRange
updateReference bool

Indicates whether to update reference cells.

Returns

CellRange

Copy(CellRange, bool, bool)

Copies the range to the specified range.

public CellRange Copy(CellRange destRange, bool updateReference, bool copyStyles)

Parameters

destRange CellRange

Destination range.

updateReference bool

Indicates whether to update reference cells.

copyStyles bool

Indicates whether to copy styles.

Returns

CellRange

Destination range

FindAllBool(bool)

Finds the cell with the input bool.

public CellRange[] FindAllBool(bool boolValue)

Parameters

boolValue bool

Bool value to search for

Returns

CellRange[]

Found ranges

FindAllDateTime(DateTime)

Finds the cell with the input datetime.

public CellRange[] FindAllDateTime(DateTime dateTimeValue)

Parameters

dateTimeValue DateTime

DateTime value to search for

Returns

CellRange[]

Found ranges

FindAllNumber(double, bool)

Finds the cell with the input double.

public CellRange[] FindAllNumber(double doubleValue, bool formulaValue)

Parameters

doubleValue double

Double value to search for

formulaValue bool

Indicates whether to find formula value

Returns

CellRange[]

Found ranges

FindAllString(string, bool, bool)

Finds the cell with the input string.

public CellRange[] FindAllString(string stringValue, bool formula, bool formulaValue)

Parameters

stringValue string

String value to search for

formula bool

Indicates whether include formula

formulaValue bool

Indicates whether include formula value

Returns

CellRange[]

Found ranges

FindAllTimeSpan(TimeSpan)

Finds the cell with input timespan

public CellRange[] FindAllTimeSpan(TimeSpan timeSpanValue)

Parameters

timeSpanValue TimeSpan

time span value to search for

Returns

CellRange[]

Found ranges

FindBool(bool)

Finds the cell with the input bool.

public CellRange FindBool(bool boolValue)

Parameters

boolValue bool

Bool value to search for

Returns

CellRange

Found range

FindDateTime(DateTime)

Finds the cell with the input datetime.

public CellRange FindDateTime(DateTime dateTimeValue)

Parameters

dateTimeValue DateTime

Datetime value to search for

Returns

CellRange

Found range

FindNumber(double, bool)

Finds the cell with the input double.

public CellRange FindNumber(double doubleValue, bool formulaValue)

Parameters

doubleValue double

Double value to search for

formulaValue bool

Indicates whether includes formula value to search for

Returns

CellRange

Found range

FindString(string, bool, bool)

Finds the cell with the input string.

public CellRange FindString(string stringValue, bool formula, bool formulaValue)

Parameters

stringValue string

String value to search for

formula bool

Indicates whether includes formula to search for

formulaValue bool

Indicates whether includes formula value to search for

Returns

CellRange

Found range

FindTimeSpan(TimeSpan)

Finds the cell with the input time span.

public CellRange FindTimeSpan(TimeSpan timeSpanValue)

Parameters

timeSpanValue TimeSpan

Time span value to search for.

Returns

CellRange

Found range.

Intersect(CellRange)

Get intersection range with the specified range.

public CellRange Intersect(CellRange range)

Parameters

range CellRange

Range which to intersect.

Returns

CellRange

Range intersection.

Move(CellRange)

Moves the cells to the specified Range.

public void Move(CellRange destRange)

Parameters

destRange CellRange

Move(CellRange, bool)

Moves the cells to the specified Range.

public void Move(CellRange destRange, bool updateReference)

Parameters

destRange CellRange
updateReference bool

Indicates whether to update reference range.

Remove(CellRange)

Removes range from the collection.

public void Remove(CellRange range)

Parameters

range CellRange

Range to remove.