[]
        
(Showing Draft Content)

C1.Excel.XLNamedRangeCollection.Add

Add Method

Add(XLNamedRange)

Appends an XLNamedRange object to the collection.

Declaration
public XLNamedRange Add(XLNamedRange namedRange)
Parameters
Type Name Description
XLNamedRange namedRange

The XLNamedRange object to add to the collection.

Returns
Type Description
XLNamedRange

A reference to the object if it was successfully added to the collection, or null if the object could not be added (usually because it overlaps another cell range already in the collection).

Add(string, XLCellRange)

Creates an XLNamedRange object and appends it to the collection.

Declaration
public XLNamedRange Add(string name, XLCellRange cellRange)
Parameters
Type Name Description
string name

The name of the named range to create.

XLCellRange cellRange

The XLCellRange to include in the named range.

Returns
Type Description
XLNamedRange

A reference to the object if it was successfully added to the collection, or null if the object could not be added (usually because it overlaps another cell range already in the collection).

Add(string, XLCellRange[])

Creates an XLNamedRange object and appends it to the collection.

Declaration
public XLNamedRange Add(string name, XLCellRange[] cellRanges)
Parameters
Type Name Description
string name

The name of the named range to create.

XLCellRange[] cellRanges

The array of XLCellRange to include in the named range.

Returns
Type Description
XLNamedRange

A reference to the object if it was successfully added to the collection, or null if the object could not be added (usually because it overlaps another cell range already in the collection).

Add(string, XLSheet, int, int)

Creates an XLNamedRange object and appends it to the collection. This overload creates a range containing a single cell.

Declaration
public XLNamedRange Add(string name, XLSheet sheet, int rowIndex, int colIndex)
Parameters
Type Name Description
string name

The name of XLNamedRange object.

XLSheet sheet

The worksheet the range belongs to.

int rowIndex

The row index of the cell in the range.

int colIndex

The column index of the cell in the range.

Returns
Type Description
XLNamedRange

A reference to the object if it was successfully added to the collection, or null if the object could not be added (usually because it overlaps another cell range already in the collection).

Add(string, int, int, int, int)

Creates an XLNamedRange object and appends it to the collection. This overload allows you to create a 3-D reference to the same range of cells on multiple worksheets.

Declaration
public XLNamedRange Add(string name, int firstSheetIndex, int lastSheetIndex, int rowIndex, int colIndex)
Parameters
Type Name Description
string name

The name of XLNamedRange object.

int firstSheetIndex

The index of the first XLSheet to include.

int lastSheetIndex

The index of the last XLSheet to include.

int rowIndex

The index of the top row in the cell range.

int colIndex

The index of the left column in the cell range.

Returns
Type Description
XLNamedRange

A reference to the object if it was successfully added to the collection, or null if the object could not be added (usually because it overlaps another cell range already in the collection).

Add(string, XLSheet, int, int, int, int)

Creates an XLNamedRange object and appends it to the collection.

Declaration
public XLNamedRange Add(string name, XLSheet sheet, int rowIndex, int colIndex, int rowCount, int colCount)
Parameters
Type Name Description
string name

The name of XLNamedRange object.

XLSheet sheet

The worksheet containing the range.

int rowIndex

The index of the top row in the cell range.

int colIndex

The index of the left column in the cell range.

int rowCount

The number of rows in the cell range.

int colCount

The number of columns in the cell range.

Returns
Type Description
XLNamedRange

A reference to the object if it was successfully added to the collection, or null if the object could not be added (usually because it overlaps another cell range already in the collection).