Message-ID: <1606021516.9451.1711691433987.JavaMail.web05$@web05> Subject: Exported From Confluence MIME-Version: 1.0 Content-Type: multipart/related; boundary="----=_Part_9450_1374679306.1711691433987" ------=_Part_9450_1374679306.1711691433987 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Content-Location: file:///C:/exported.html Range

Range

Description

=20

A Range object represents a range in = a workbook.

=20
C#
=20
[DefaultMember("Item")]
 public sealed class Range
=20
=20
vb.net
=20
<DefaultMember("Item")> _
=09Public NotInheritable Class Range
=20
=20

Remarks

=20

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 a= reas in different worksheets.

=20

To create a Range (without a name), call one of the followi= ng methods:

=20 =20

If a range is named, it will be accessible when the workbook is opened i= n Microsoft Excel. To create a named range, call one of the following metho= ds:

=20 =20

Examples

=20
C#
=20

          ExcelApplication xla =3D new ExcelApplication();
          Workbook wb =3D xla.Create();
          wb.Worksheets.CreateWorksheet("Sheet2");
          Range rng =3D wb.CreateRange("=3DSheet1!A1:A3, Sheet2!A2:C5&=
quot;);
        
=20
=20
vb.net
=20

          Dim xla As New ExcelApplication()
          Dim wb As Workbook =3D xla.Create()
          wb.Worksheets.CreateWorksheet("Sheet2")
          Dim rng As Range =3D wb.CreateRange("=3DSheet1!A1:A3, Sheet2=
!A2:C5")
        
=20
=20

Properties

=20
=20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20

Name

Description

Area= Count

Returns the number of Area objects contained in this Range= .

Areas

Returns an array of the rectangular areas contai= ned in the Range.

B= orderAround

Returns a Border= object that represents a border around the range.

FirstCellStyle

Returns the style for the first cell in the rang= e. Changes to this style will apply only to the first cell. To assign this style to the entire Range, set Range.SetStyle() to this Style reference.
=20

Indexers

=20
=20 =20 =20 =20 =20 =20 =20 =20 =20

Name

Description

Item(Int32)

Returns the Area object at the specified 0-based index.
=20

Methods

=20
=20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20

Name

Description

ApplyStyle(Style)

Applies a style to the area. When a style is app= lied - rather than set (see Range.SetStyle ) - only the differences between the new style and = style properties previously assigned to the range (through the ExcelWriter = API) will take effect. For example, if the range has a background color and= the new style applied does not contain a background color, the area's colo= r will not be affected.

ClearContent()

Clears the content of all cells in the range. Ca= lling this method is equivalent to setting an range's style to "Normal= " and its cell values to null.

JoinRange(Range)

Adds another range to this range.

RemoveConditionalFormat()

This method removes any ConditionalFormat object= s from the Range.

SetConditionalFormat(ConditionalFormat)

This method copies the specified ConditionaForma= t object and associates it with this Range. If any ConditionalFormat object= s already exist within the Range, they will be removed and replaced by the = specifed one.

SetDataValidation(DataValidation)

Assigns a data validation rule to all cells in t= he Range. If the DataValidation= object uses a local reference or area in a formula (i.e. "=3DA5:B7&qu= ot;), then the range will adjust those local references accordingly based o= n the range's location. The original DataValidation object wil= l not be affected.

SetStyle(Style)

Sets the style for every cell in this range. Whe= n a style is set - rather than applied (see Range.ApplyStyle ) - all previously assigned style= properties, including font and number formatting, will be overwritten for = all cells in the range.

ToString()

Returns a string representation of the Range object.
------=_Part_9450_1374679306.1711691433987--