Click or drag to resize

RangesCollection Class

Represents a collection of range objects, providing methods to manipulate and query the ranges.
Inheritance Hierarchy
System Object
Spire.Xls.Core.Spreadsheet.Collections CollectionBase IXLSRange
Spire.Xls.Core.Spreadsheet.Collections CollectionExtended IXLSRange
Spire.Xls.Core.Spreadsheet.Collections XlsRangesCollection
Spire.Xls.Collections RangesCollection

Namespace: Spire.Xls.Collections
Assembly: Spire.XLS (in Spire.XLS.dll) Version: 15.4.0.0 (15.4.0.5046)
Syntax
public class RangesCollection : XlsRangesCollection

The RangesCollection type exposes the following members.

Properties
Name Description
Public property BooleanValue
Gets / sets boolean value that is contained by this range.
(Inherited from XlsRangesCollection .)
Public property 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 property BuiltInStyle
Gets/sets built in style.
(Inherited from XlsRangesCollection .)
Public property Capacity
Gets or sets the number of elements that the System.Collections.CollectionBase can contain.
(Inherited from CollectionBase T .)
Public property CellList
Returns a Range object that represents the cells in the specified range. For big number of ranges can be very slow operation. Read-only.
(Inherited from XlsRangesCollection .)
Public property Cells
Returns a Range object that represents the cells in the specified range.
Public property CellsCount
Number of cells in the range. Read-only.
(Inherited from XlsRangesCollection .)
Public property CellStyleName
Returns name of the Style object that represents the style of the specified range. Read/write String.
(Inherited from XlsRangesCollection .)
Public property Column
Returns the number of the first column in the first area in the specified range. Read-only.
(Inherited from XlsRangesCollection .)
Public property ColumnGroupLevel
Column group level. Read-only. -1 - Not all columns in the range have same group level. 0 - No grouping, 1 - 7 - Group level.
(Inherited from XlsRangesCollection .)
Public property Columns
Returns a Range object that represents the columns in the specified range
Public property ColumnWidth
Returns or sets the width of all columns in the specified range. Read/write Double.
(Inherited from XlsRangesCollection .)
Public property Comment
Returns a Comment object that represents the comment associated with the cell in the upper-left corner of the range.
Public property ConditionalFormats
Collection of conditional formats.
(Inherited from XlsRangesCollection .)
Public property Count
Gets the number of elements contained in the System.Collections.CollectionBase instance.
(Inherited from CollectionBase T .)
Public property DataValidation
Data validation for the range.
(Inherited from XlsRangesCollection .)
Public property DateTimeValue
Gets / sets DateTime contained by this cell. Read-write DateTime.
(Inherited from XlsRangesCollection .)
Public property EndCell
Returns a Range object that represents the cell at the end of the region that contains the source range.
Public property EntireColumn
Returns a Range object that represents the entire column (or columns) that contains the specified range.
Public property EntireRow
Returns a Range object that represents the entire row (or rows) that contains the specified range.
Public property EnvalutedValue
Gets the evaluated value. Currently, this property always returns null.
(Inherited from XlsRangesCollection .)
Public property ErrorValue
Gets / sets error value that is contained by this range.
(Inherited from XlsRangesCollection .)
Public property Formula
Returns or sets the object's formula in A1-style notation and in the language of the macro. Read/write Variant.
(Inherited from XlsRangesCollection .)
Public property FormulaArray
Represents array-entered formula. Visit http://www.cpearson.com/excel/array.htm for more information.
(Inherited from XlsRangesCollection .)
Public property FormulaArrayR1C1
Returns or sets the array-entered formula in R1C1-style notation and in the language of the macro. Read/write Variant.
(Inherited from XlsRangesCollection .)
Public property FormulaBoolValue
Returns the calculated value of the formula as a boolean.
(Inherited from XlsRangesCollection .)
Public property FormulaDateTime
Get / set formula DateTime value contained by this cell. DateTime.MinValue if not all cells of the range have same DateTime value.
(Inherited from XlsRangesCollection .)
Public property FormulaErrorValue
Returns the calculated value of the formula as a string.
(Inherited from XlsRangesCollection .)
Public property FormulaNumberValue
Returns the calculated value of the formula as a Number.
(Inherited from XlsRangesCollection .)
Public property FormulaR1C1
Returns or sets the object's formula in R1C1-style notation and in the language of the macro. Read/write Variant.
(Inherited from XlsRangesCollection .)
Public property FormulaStringValue
(Inherited from XlsRangesCollection .)
Public property HasBoolean
Indicates whether range contains bool value. Read-only.
(Inherited from XlsRangesCollection .)
Public property HasDataValidation
Indicates whether specified range object has data validation. If Range is not single cell, then returns true only if all cells have data validation. Read-only.
(Inherited from XlsRangesCollection .)
Public property HasDateTime
Indicates whether range contains DateTime value. Read-only.
(Inherited from XlsRangesCollection .)
Public property HasError
Indicates whether range contains error value.
(Inherited from XlsRangesCollection .)
Public property HasExternalFormula
Indicates is current range has external formula. Read-only.
(Inherited from XlsRangesCollection .)
Public property HasFormula
True if all cells in the range contain formulas; False if at least one of the cells in the range doesn't contain a formula. Read-only Boolean.
(Inherited from XlsRangesCollection .)
Public property HasFormulaArray
Indicates whether range contains array-entered formula. Read-only.
(Inherited from XlsRangesCollection .)
Public property HasFormulaBoolValue
Indicates if current range has formula bool value. Read only.
(Inherited from XlsRangesCollection .)
Public property HasFormulaDateTime
Indicates if current range has formula value formatted as DateTime. Read-only.
(Inherited from XlsRangesCollection .)
Public property HasFormulaErrorValue
Indicates if current range has formula error value. Read only.
(Inherited from XlsRangesCollection .)
Public property HasFormulaNumberValue
Determines whether the object has a formula that evaluates to a numeric value.
(Inherited from XlsRangesCollection .)
Public property HasFormulaStringValue
Determines whether the object has a formula string value.
(Inherited from XlsRangesCollection .)
Public property HasMerged
Indicates whether this range is part of merged range. Read-only.
(Inherited from XlsRangesCollection .)
Public property HasNumber
Indicates whether the range contains number. Read-only.
(Inherited from XlsRangesCollection .)
Public property HasRichText
Indicates whether cell contains formatted rich text string.
(Inherited from XlsRangesCollection .)
Public property HasString
Indicates whether the range contains String. Read-only.
(Inherited from XlsRangesCollection .)
Public property HasStyle
Indicates whether range has default style. False means default style. Read-only.
(Inherited from XlsRangesCollection .)
Public property HorizontalAlignment
Returns or sets the horizontal alignment for the specified object. Read/write HorizontalAlignType.
(Inherited from XlsRangesCollection .)
Public property HtmlString
Gets and sets the html string which contains data and some formattings in this cell.
(Inherited from XlsRangesCollection .)
Public property Hyperlinks
Returns hyperlinks for this ranges collection.
(Inherited from XlsRangesCollection .)
Public property IgnoreErrorOptions
Represents ignore error options. If not single cell returs concatenateed flags.
(Inherited from XlsRangesCollection .)
Public property IndentLevel
Returns or sets the indent level for the cell or range. Can be an integer from 0 to 15. Read/write Integer.
(Inherited from XlsRangesCollection .)
Protected property InnerList
Gets the list of elements in the instance.
(Inherited from CollectionBase T .)
Public property IsBlank
Indicates whether the range is blank. Read-only.
(Inherited from XlsRangesCollection .)
Public property IsFormulaHidden
True if the formula will be hidden when the worksheet is protected. False if at least part of formula in the range is not hidden.
(Inherited from XlsRangesCollection .)
Public property IsGroupedByColumn
Indicates whether this range is grouped by column. Read-only.
(Inherited from XlsRangesCollection .)
Public property IsGroupedByRow
Indicates whether this range is grouped by row. Read-only.
(Inherited from XlsRangesCollection .)
Public property IsInitialized
Indicates whether cell is initialized. Read-only.
(Inherited from XlsRangesCollection .)
Public property IsReadOnly
Gets a value indicating whether the collection is read-only.
(Inherited from CollectionBase T .)
Public property IsStringsPreserved
Indicates whether all values in the range are preserved as strings.
(Inherited from XlsRangesCollection .)
Public property IsWrapText
True if Microsoft Excel wraps the text in the object. Read/write Boolean.
(Inherited from XlsRangesCollection .)
Public property Item Int32
Returns item by index from the collection.
(Inherited from XlsRangesCollection .)
Public property Item String
Get cell range.
(Inherited from XlsRangesCollection .)
Public property Item Int32, Int32
Gets / sets cell by row and index.
(Inherited from XlsRangesCollection .)
Public property Item String, Boolean
Gets cell range. Read-only.
(Inherited from XlsRangesCollection .)
Public property Item Int32, Int32, Int32, Int32
Get cell range.
(Inherited from XlsRangesCollection .)
Public property LastColumn
Returns last column of the range. Read-only.
(Inherited from XlsRangesCollection .)
Public property LastRow
Returns last row of the range. Read-only.
(Inherited from XlsRangesCollection .)
Protected property List
Gets the list of elements in the instance.
(Inherited from CollectionBase T .)
Public property MergeArea
Returns a Range object that represents the merged range containing the specified cell.
Public property NumberFormat
Format of current cell. Analog of Style.NumberFormat property.
(Inherited from XlsRangesCollection .)
Public property NumberText
Returns cell value after number format application. Read-only.
(Inherited from XlsRangesCollection .)
Public property NumberValue
Gets / sets double value of the range.
(Inherited from XlsRangesCollection .)
Public property Parent
Read-oonly. The parent object for the specified object.
(Inherited from CollectionExtended T .)
Public property RangeAddress
Returns the range reference in the language of the macro. Read-only String.
(Inherited from XlsRangesCollection .)
Public property RangeAddressLocal
Returns the range reference for the specified range in the language of the user. Read-only String.
(Inherited from XlsRangesCollection .)
Public property RangeGlobalAddress
Returns the range reference in the language of the macro. Read-only String.
(Inherited from XlsRangesCollection .)
Public property RangeGlobalAddress2007
Gets address global in the format required by Excel 2007.
(Inherited from XlsRangesCollection .)
Public property RangeR1C1Address
Returns the range reference in the language of the macro using R1C1-style reference. Read-only String.
(Inherited from XlsRangesCollection .)
Public property RangeR1C1AddressLocal
Returns the range reference for the specified range in the language of the user using R1C1 style reference . Read-only String.
(Inherited from XlsRangesCollection .)
Public property RichText
Returns a RichTextString object that represents the rich text style.
Public property Row
Returns the number of the first row of the first area in the range. Read-only Long.
(Inherited from XlsRangesCollection .)
Public property RowGroupLevel
Row group level. Read-only. -1 - Not all rows in the range have same group level. 0 - No grouping, 1 - 7 - Group level.
(Inherited from XlsRangesCollection .)
Public property RowHeight
Returns the height of all the rows in the range specified, measured in points. Returns Double.MinValue if the rows in the specified range aren't all the same height. Read / write Double.
(Inherited from XlsRangesCollection .)
Public property Rows
Returns the number of the first row of the first area in the range.
Public property Style
Returns a Style object that represents the style of the specified range
Public property Text
Gets / sets string value of the range.
(Inherited from XlsRangesCollection .)
Public property TimeSpanValue
Gets / sets time value of the range.
(Inherited from XlsRangesCollection .)
Public property Value
Returns or sets the value of the specified range. Read/write Variant.
(Inherited from XlsRangesCollection .)
Public property Value2
Returns or sets the cell value. Read/write Variant. The only difference between this property and the Value property is that the Value2 property doesn't use the Currency and Date data types.
(Inherited from XlsRangesCollection .)
Public property VerticalAlignment
Returns or sets the vertical alignment of the specified object. Read/write VerticalAlignType.
(Inherited from XlsRangesCollection .)
Public property Worksheet
Gets the Worksheet object associated with this instance, casting it from the base class.
Public property WorksheetName
Gets name of the parent worksheet.
(Inherited from XlsRangesCollection .)
Top
Methods
Name Description
Public method Activate
Activages a single cell, scroll to it and activates the respective sheet To select a range of cells, use the Select method.
(Inherited from XlsRangesCollection .)
Public method Add(CellRange)
Adds a range to the collection.
Protected method Add(IXLSRange)
Adds new range to the collection.
(Inherited from XlsRangesCollection .)
Public method AddComment
Adds a comment to the range.
Public method AddRange(CellRange)
Adds a range to the collection.
Protected method AddRange(IXLSRange)
Adds range to the collection.
(Inherited from XlsRangesCollection .)
Public method AutoFitColumns
Autofits all columns.
(Inherited from XlsRangesCollection .)
Public method AutoFitRows
Autofits all rows.
(Inherited from XlsRangesCollection .)
Public method BorderAround
Sets around border for current range.
(Inherited from XlsRangesCollection .)
Public method BorderAround(LineStyleType)
Sets around border for current range.
(Inherited from XlsRangesCollection .)
Public method BorderAround(LineStyleType, ExcelColors)
Sets around border for current range.
(Inherited from XlsRangesCollection .)
Public method BorderAround(LineStyleType, Color)
Sets around border for current range.
(Inherited from XlsRangesCollection .)
Public method BorderInside
Sets inside border for current range.
(Inherited from XlsRangesCollection .)
Public method BorderInside(LineStyleType)
Sets inside border for current range.
(Inherited from XlsRangesCollection .)
Public method BorderInside(LineStyleType, ExcelColors)
Sets inside border for current range.
(Inherited from XlsRangesCollection .)
Public method BorderInside(LineStyleType, Color)
Sets inside border for current range.
(Inherited from XlsRangesCollection .)
Public method BorderNone
Sets none border for current range.
(Inherited from XlsRangesCollection .)
Public method Clear
Removes all objects from the System.Collections.CollectionBase instance.
(Inherited from CollectionBase T .)
Public method ClearConditionalFormats
Clears conditional formats.
(Inherited from XlsRangesCollection .)
Public method Clone(Object)
Creates copy of the collection.
(Inherited from CollectionExtended T .)
Public method Clone(Object, Dictionary String, String , XlsWorkbook)
Clones current IXLSRange.
(Inherited from XlsRangesCollection .)
Public method CollapseGroup
Collapses current group.
(Inherited from XlsRangesCollection .)
Public method Contains
Determines whether the collection contains a specific item.
(Inherited from CollectionBase T .)
Public method Copy(CellRange)
Copies the range to the specified range.
Public method Copy(CellRange, Boolean)
Copies the range to the specified range.
Public method Copy(CellRange, Boolean, Boolean)
Copies the range to the specified range.
Public method CopyTo
Copies the elements of the collection to an array, starting at a particular array index.
(Inherited from CollectionBase T .)
Public method EnsureCapacity
Enlarges internal storage if necessary.
(Inherited from CollectionExtended T .)
Public method Equals
Determines whether the specified object is equal to the current object.
(Inherited from Object .)
Public method ExpandGroup(GroupByType)
Expands current group.
(Inherited from XlsRangesCollection .)
Public method ExpandGroup(GroupByType, ExpandCollapseFlags)
Expands current group.
(Inherited from XlsRangesCollection .)
Public method ExportDataTable Obsolete.
Exports data to a DataTable based on the provided ExportTableOptions.
(Inherited from XlsRangesCollection .)
Protected method Finalize
Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object .)
Protected method FindAll(Boolean)
This method seraches for the all cells with specified bool value.
(Inherited from XlsRangesCollection .)
Protected method FindAll(DateTime)
This method seraches for the all cells with specified DateTime value.
(Inherited from XlsRangesCollection .)
Protected method FindAll(TimeSpan)
This method seraches for the all cells with specified TimeSpan value.
(Inherited from XlsRangesCollection .)
Protected method FindAll(Double, FindType)
This method seraches for the all cells with specified double value.
(Inherited from XlsRangesCollection .)
Protected method FindAll(String, FindType)
This method seraches for the all cells with specified string value.
(Inherited from XlsRangesCollection .)
Public method FindAllBool
Finds the cell with the input bool.
Public method FindAllDateTime
Finds the cell with the input datetime.
Public method FindAllNumber
Finds the cell with the input double.
Public method FindAllString
Finds the cell with the input string.
Public method FindAllTimeSpan
Finds the cell with input timespan
Public method FindBool
Finds the cell with the input bool.
Public method FindDateTime
Finds the cell with the input datetime.
Protected method FindFirst(Boolean)
This method seraches for the first cell with specified bool value.
(Inherited from XlsRangesCollection .)
Protected method FindFirst(DateTime)
This method seraches for the first cell with specified DateTime value.
(Inherited from XlsRangesCollection .)
Protected method FindFirst(TimeSpan)
This method seraches for the first cell with specified TimeSpan value.
(Inherited from XlsRangesCollection .)
Protected method FindFirst(Double, FindType)
This method seraches for the first cell with specified double value.
(Inherited from XlsRangesCollection .)
Protected method FindFirst(String, FindType)
This method seraches for the first cell with specified string value.
(Inherited from XlsRangesCollection .)
Public method FindNumber
Finds the cell with the input double.
Protected method FindParent(Type)
Method used to find parent within a specific type.
(Inherited from CollectionExtended T .)
Protected method FindParent(Type, Boolean)
Method used to find parent within a specific type.
(Inherited from CollectionExtended T .)
Public method FindString
Finds the cell with the input string.
Public method FindTimeSpan
Finds the cell with the input time span.
Public method FreezePanes
Freezes pane at the current range.
(Inherited from XlsRangesCollection .)
Protected method GetColumnRows
Retrieves an array of CellRange objects representing either columns or rows based on the provided flag.
(Inherited from XlsRangesCollection .)
Public method GetEnumerator
Returns an enumerator that iterates through the collection.
(Inherited from XlsRangesCollection .)
Public method GetHashCode
Serves as the default hash function.
(Inherited from Object .)
Public method GetNewRangeLocation
Gets new address of range.
(Inherited from XlsRangesCollection .)
Public method GetRectangles
Returns array that contains information about range.
(Inherited from XlsRangesCollection .)
Public method GetRectanglesCount
Returns number of rectangles returned by GetRectangles method.
(Inherited from XlsRangesCollection .)
Public method GetType
Gets the Type of the current instance.
(Inherited from Object .)
Public method IndexOf
Returns the zero-based index of the first occurrence of a specified item within the collection.
(Inherited from CollectionBase T .)
Public method Insert
Inserts an element into the list at the specified index.
(Inherited from CollectionBase T .)
Public method Intersect(CellRange)
Get intersection range with the specified range.
Public method Intersect(IXLSRange)
Returns intersection of this range with the specified one.
(Inherited from XlsRangesCollection .)
Protected method MemberwiseClone
Creates a shallow copy of the current Object .
(Inherited from Object .)
Public method Merge
Creates a merged cell from the specified Range object.
(Inherited from XlsRangesCollection .)
Public method Merge(Boolean)
Creates a merged cell from the specified Range object.
(Inherited from XlsRangesCollection .)
Public method Merge(IXLSRange)
Returns merge of this range with the specified one.
(Inherited from XlsRangesCollection .)
Public method Move(CellRange)
Moves the cells to the specified Range.
Public method Move(CellRange, Boolean)
Moves the cells to the specified Range.
Protected method MoveTo
Moves the current object to the specified destination range.
(Inherited from XlsRangesCollection .)
Protected method OnClear
OnClear is invoked before Clear behavior.
(Inherited from CollectionExtended T .)
Protected method OnClearComplete
OnClear is invoked after Clear behavior.
(Inherited from CollectionExtended T .)
Protected method OnInsert
Performs additional processes before inserting a new element into the collection.
(Inherited from CollectionExtended T .)
Protected method OnInsertComplete
Performs additional processes after inserting a new element into the collection.
(Inherited from CollectionExtended T .)
Protected method OnRemove
Performs additional processes before removing an element from the collection.
(Inherited from CollectionExtended T .)
Protected method OnRemoveComplete
Performs additional processes after removing an element from the collection.
(Inherited from CollectionExtended T .)
Protected method OnSet
Performs additional processes before setting a value in the collection.
(Inherited from CollectionExtended T .)
Protected method OnSetComplete
Performs additional processes after setting a value in the collection.
(Inherited from CollectionExtended T .)
Public method Remove(CellRange)
Removes range from the collection.
Public method Remove(IXLSRange)
Removes range from the collection.
(Inherited from XlsRangesCollection .)
Public method RemoveAt
Removes the element at the specified index of this instance.
(Inherited from CollectionBase T .)
Protected method SetParent
Sets parent object for class.
(Inherited from CollectionExtended T .)
Public method ToString
Returns a string that represents the current object.
(Inherited from Object .)
Public method UnMerge
Separates a merged area into individual cells.
(Inherited from XlsRangesCollection .)
Top
Events
See Also