Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 4.0
Description

Excerpt

A Range object represents a range in a workbook.

|Worksheet.CreateNamedRange(String, String)]

{remarks}
{example}{code:csharp|title=C#}

          ExcelApplication xla = new ExcelApplication();
          Workbook wb = xla.Create();
          wb.Worksheets.CreateWorksheet("Sheet2");
          Range rng = wb.CreateRange("=Sheet1!A1:A3, Sheet2!A2:C5");
        
{code}
{code:vbnet|title=vb.net
}

          Dim xla As New ExcelApplication()
          Dim wb As Workbook = xla.Create()
          wb.Worksheets.CreateWorksheet("Sheet2")
          Dim rng As Range = wb.CreateRange("=Sheet1!A1:A3, Sheet2!A2:C5")
        
Signature
C#C#
Wiki Markup
{description}
{excerpt}A [Range|Range] object represents a range in a workbook.{excerpt}
{signature:C#}
[DefaultMember("Item")]
 public sealed class Range
Signature
{signature}{signature:vb.net
vb.net
}
<DefaultMember("Item")> _
	Public NotInheritable Class Range
Remarks

A range is a collection of areas. An area is a rectangular collection of cells. The areas in a range may be non-adjacent, and a range can include areas in different worksheets.

To create a Range (without a name), call one of the following methods:

If a range is named, it will be accessible when the workbook is opened in Microsoft Excel. To create a named range, call one of the following methods:

{signature}
{remarks}A range is a collection of areas. An area is a rectangular collection of cells. The areas in a range may be non\-adjacent, and a range can include areas in different worksheets.

To create a {{Range}} \(without a name\), call one of the following methods:
* [Workbook.CreateRange(rangeFormula)|Workbook.CreateRange(String)]
* [Worksheet.CreateRange(rangeFormula)|Worksheet.CreateRange(String)]

If a range is named, it will be accessible when the workbook is opened in  Microsoft Excel. To create a named range, call one of the following methods:
* [Workbook.CreateNamedRange(rangeFormula, rangeName)
|Workbook.CreateNamedRange(String, String)]
* [Worksheet.CreateNamedRange(firstRow, firstColumn, numRows, numColumns, rangeName)
|Worksheet.CreateNamedRange(Int32, Int32, Int32, Int32, String)]
* [Worksheet.CreateNamedRange(rangeFormula, rangeName)
Example
Code Block
csharpcsharp
titleC#
Code Block
vbnetvbnettitle
Properties

...

Name

...

Description

...

AreaCount

...

{code}

{example}
{properties}
||Name||Description||
|[AreaCount|Range.AreaCount]|{excerpt-include:Range.AreaCount

...

Areas

|nopanel=true}|
|[Areas|Range.Areas]|{excerpt-include

...

:Range.Areas

...

BorderAround

|nopanel=true}|
|[BorderAround|Range.BorderAround]|{excerpt-include

...

:Range.BorderAround

...

FirstCellStyle

|nopanel=true}|
|[FirstCellStyle|Range.FirstCellStyle]|{excerpt-include

...

:Range.FirstCellStyle

...

Indexers

...

Name

...

Description

|nopanel=true}|
{indexers}
||Name||Description||
|[Item(Int32)

...

|Range.Item(Int32)

...

]|{excerpt-include:Range.Item(Int32)

...

|nopanel

...

Methods

...

Name

...

Description

=true}|
{methods}
||Name||Description||
|[ApplyStyle(Style)

...

|Range.ApplyStyle(Style)

...

]|{excerpt-include:Range.ApplyStyle(Style)

...

|nopanel

...

=true}|
|[ClearContent()

...

|Range.ClearContent()

...

]|{excerpt-include:Range.ClearContent()

...

|nopanel

...

=true}|
|[JoinRange(Range)

...

|Range.JoinRange(Range)

...

]|{excerpt-include:Range.JoinRange(Range)

...

|nopanel

...

=true}|
|[RemoveConditionalFormat()

...

|Range.RemoveConditionalFormat()

...

]|{excerpt-include:Range.RemoveConditionalFormat()

...

|nopanel

...

=true}|
|[SetConditionalFormat(ConditionalFormat)

...

|Range.SetConditionalFormat(ConditionalFormat)

...

]|{excerpt-include:Range.SetConditionalFormat(ConditionalFormat)

...

|nopanel

...

=true}|
|[SetDataValidation(DataValidation)

...

|Range.SetDataValidation(DataValidation)

...

]|{excerpt-include:Range.SetDataValidation(DataValidation)

...

|nopanel

...

=true}|
|[SetStyle(Style)

...

|Range.SetStyle(Style)

...

]|{excerpt-include:Range.SetStyle(Style)

...

|nopanel

...

=true}|
|[ToString()

...

|Range.ToString()

...

]|{excerpt-include:Range.ToString()

...

|nopanel

...

=true}|