Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migration of unmigrated content due to installation of a new plugin

...

Description

Excerpt

Creates a named range, containing one area. A range is a collection of areas; an area is a rectangular collection of cells.

Signature
C#
C#
 public Range CreateNamedRange(int firstRow, int firstColumn, int numRows, int numColumns, System.String rangeName)
{signature}{signature:
}
Signature
vb.net
vb.net
Public Function CreateNamedRange(ByVal firstRow As Integer, ByVal firstColumn As Integer, ByVal numRows As Integer, ByVal numColumns As Integer, ByVal rangeName As String) As Range
{signature}
{parameters}
{param:firstRow}0\-based first row of the range.{param}
{param:firstColumn}0\-based first column column of the range.{param}
{param:numRows}Number of rows in the area. Maximum: The row limit of the file format you are using.{param}
{param:numColumns}Number of columns in the range. Maximum: The column limit of the file fortmat you are using.{param}
{param:rangeName}The name of the new range.{param}
{returns}A [Range|Range] object.{returns}
{remarks}
Note that if a range named {{rangeName}} already exists in the worksheet, it will be overwritten with the new named range created by this method.
{remarks}
{example}{code:csharp|title=C#}
Parameters
Param
firstRow
firstRow

0-based first row of the range.

Param
firstColumn
firstColumn

0-based first column column of the range.

Param
numRows
numRows

Number of rows in the area. Maximum: The row limit of the file format you are using.

Param
numColumns
numColumns

Number of columns in the range. Maximum: The column limit of the file fortmat you are using.

Param
rangeName
rangeName

The name of the new range.

Returns

A Range object.

Remarks

Note that if a range named rangeName already exists in the worksheet, it will be overwritten with the new named range created by this method.

Example
Code Block
csharp
csharp
titleC#

Range rng = ws.CreateNamedRange(4, 4, 15, 6, "Range1");
{code} {code:
Code Block
vb.net
|title=
vb.net
titlevb.net
}

Dim rng As Range = ws.CreateNamedRange(4, 4, 15, 6, "Range1")
{code} {example}