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

Signature
C#
C#
 public Range CreateNamedRange(System.String rangeFormula, System.String rangeName)
{signature}{signature:
}
Signature
vb.net
vb.net
Public Function CreateNamedRange(ByVal rangeFormula As String, ByVal rangeName As String) As Range
{signature}
{parameters}
{param:rangeFormula}Formula representing the range, for example "=Sheet1\
Parameters
Param
rangeFormula
rangeFormula

Formula representing the range, for example "=Sheet1!A1:G10".

The

formula

must

be

three

\

-dimensional

\

(specify

a

sheet

\

),

and

can

include

only

sheet

and

cell

references,

and

operators

joining

those

references

\

(range

':',

intersection

'

',

and

union

','

\

).

Functions

that

return

ranges

cannot

be

used.

{param} {param:rangeName}The name to assign to the range.{param} {returns}Range 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#}

Param
rangeName
rangeName

The name to assign to the range.

Returns

Range 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("=Sheet1!A1:G10", "Range1");
{code} {code:
Code Block
vb.net
|title=
vb.net
titlevb.net
}

Dim rng As Range = wb.CreateNamedRange("=Sheet1!A1:G10", "Range1")
{code} {example}