Export (0) Print
Expand All

Range Interface 

Represents a cell, a row, a column, a selection of cells containing one or more contiguous blocks of cells, or a 3-D range.

Namespace: Microsoft.Office.Interop.Excel
Assembly: Microsoft.Office.Interop.Excel (in microsoft.office.interop.excel.dll)

'Usage
Public Class angeImplementation
	Implements Range
End Class
Dim angeImplementation1 As New angeImplementation()

public interface Range
public interface Range
public interface Range

The following properties and methods for returning a Range object are described in this section:

Use Range(arg), where arg names the range, to return a Range object that represents a single cell or a range of cells.

If you use a text argument for the range address, you must specify the address in A1-style notation (you cannot use R1C1-style notation).

Cells Property

Use Cells(row, column), where row is the row index and column is the column index, to return a single cell.

There may be times when the Cells property is more convenient because you can use a variable for the row or column. Note that after the worksheet has been activated, the Cells property can be used without an explicit sheet declaration (it returns a cell on the active sheet).

Use Cells(row, column), where row and column are relative to the upper-left corner of the range, to return part of a range.

Range and Cells

Use Range(cell1, cell2), where cell1 and cell2 are Range objects that specify the start and end cells, to return a Range object.

Offset Property

Use Offset(row, column), where row and column are the row and column offsets, to return a range at a specified offset to another range. You cannot select a cell that isn’t on the active sheet, so you must first activate the worksheet.

Union Method

Use Union(range1, range2, ...) to return multiple-area ranges — that is, ranges composed of two or more contiguous blocks of cells.

If you work with selections that contain more than one area, the Areas property is very useful. It divides a multiple-area selection into individual Range objects and then returns the objects as a collection. You can use the Count property on the returned collection to check for a selection that contains more than one area.


Development Platforms

Windows XP Home Edition, Windows XP Professional, Windows Server 2003, and Windows 2000

Target Platforms

Community Additions

ADD
Show:
© 2014 Microsoft