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

A Range object represents a range in a workbook.

Signature
C#
C#
[DefaultMember("Item")]
 public sealed class Range
{signature}{signature:
}
Signature
vb.net
vb.net
<DefaultMember("Item")> _
	Public NotInheritable Class Range
{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:
* [
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:

|Workbook.CreateNamedRange(String, String)] * [ |Int32, Int32, Int32, Int32, String)] * [Worksheet.CreateNamedRange( |Worksheet.CreateNamedRange(String, String)] {remarks} {example}{code:csharp|title=C#}
Example
Code Block
csharp
csharp
titleC#


          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=
Code Block
vbnet
vbnet
titlevb.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")
        
{code} {example} {properties} ||Name||Description|| |[AreaCount|Range.AreaCount]|{excerpt-include:Range.AreaCount|nopanel=true}| |[Areas|Range.Areas]|{excerpt-include:Range.Areas|nopanel=true}| |[BorderAround|Range.BorderAround]|{excerpt-include:Range.BorderAround|nopanel=true}| |[FirstCellStyle|Range.FirstCellStyle]|{excerpt-include:Range.FirstCellStyle|nopanel=true}| {indexers} ||Name||Description|| |[Item(Int32)|Range.Item(Int32)]|{excerpt-include:
Properties

Name

Description

AreaCount

Excerpt Include
Range.AreaCount
Range.AreaCount
nopaneltrue

Areas

Excerpt Include
Range.Areas
Range.Areas
nopaneltrue

BorderAround

Excerpt Include
Range.BorderAround
Range.BorderAround
nopaneltrue

FirstCellStyle

Excerpt Include
Range.FirstCellStyle
Range.FirstCellStyle
nopaneltrue
Indexers

Name

Description

Item(Int32)

Excerpt Include
Range.Item(Int32)
Range.Item(Int32)

...

nopanel

...

true
Methods

Name

Description

ApplyStyle(Style)

...

Excerpt Include
Range.ApplyStyle(Style)

...

Range.ApplyStyle(Style)

...

nopanel

...

...

Excerpt Include
Range.ClearContent()

...

Range.ClearContent()

...

nopanel

...

...

Excerpt Include
Range.JoinRange(Range)

...

Range.JoinRange(Range)

...

nopanel

...

...

Excerpt Include
Range.RemoveConditionalFormat()

...

Range.RemoveConditionalFormat()

...

nopanel

...

...

Excerpt Include
Range.SetConditionalFormat(ConditionalFormat)

...

Range.SetConditionalFormat(ConditionalFormat)

...

nopanel

...

...

Excerpt Include
Range.SetDataValidation(DataValidation)

...

Range.SetDataValidation(DataValidation)

...

nopanel

...

...

Excerpt Include
Range.SetStyle(Style)

...

Range.SetStyle(Style)

...

nopanel

...

...

Excerpt Include
Range.ToString()

...

Range.ToString()

...

nopanel

...

true

...