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 Range of cells from an array of Areas. A Range is a collection of Area s; an Area area is a rectangular collection of cells.

Signature
C#
C#
 public Range CreateNamedRange(Area[] rangeAreas, System.String rangeName)
{signature}{signature:
}
Signature
vb.net
vb.net
Public Function CreateNamedRange(ByVal rangeAreas As Area(), ByVal rangeName As String) As Range
{signature}
{parameters}
{param:rangeAreas}Array or Areas representing the range.{param}
{param:rangeName}The name to assign to the range.{param}
{returns}A {{Range}} object representing the range of cells created.{returns}
{remarks}
Note that if a range named {{rangeName}} already exists in the workbook, it will be overwritten with the new named range created by this method.
{remarks}
{example}{code:csharp|title=C#}
Parameters
Param
rangeAreas
rangeAreas

Array or Areas representing the range.

Param
rangeName
rangeName

The name to assign to the range.

Returns

A Range object representing the range of cells created.

Remarks

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

Example
Code Block
csharp
csharp
titleC#


          Range rng = wb.CreateNamedRange(
               new Area[]{
               worksheet1.CreateArea(2, 4, 2, 5),
               worksheet2.CreateArea(2, 4, 2, 5)},
               "MyRange");
        
{code} {code:
Code Block
vb.net
|title=
vb.net
titlevb.net
}


          Dim rng As Range = wb.CreateNamedRange( _
               New Area(){ _
               worksheet1.CreateArea(2, 4, 2, 5), _
               worksheet2.CreateArea(2, 4, 2, 5)}, _
               "MyRange")
        
{code} {example}