Range Properties (Excel)

GitHub-Mark-64px

Contribute to this content

Use GitHub to suggest and submit changes. See our guidelines for contributing to VBA documentation.

Properties

Name

Description

AddIndent

Returns or sets a Variant value that indicates if text is automatically indented when the text alignment in a cell is set to equal distribution (either horizontally or vertically.)

Address

Returns a String value that represents the range reference in the language of the macro.

AddressLocal

Returns the range reference for the specified range in the language of the user. Read-only String.

AllowEdit

Returns a Boolean value that indicates if the range can be edited on a protected worksheet.

Application

When used without an object qualifier, this property returns an Application object that represents the Microsoft Excel application. When used with an object qualifier, this property returns an Application object that represents the creator of the specified object (you can use this property with an OLE Automation object to return the application of that object). Read-only.

Areas

Returns an Areas collection that represents all the ranges in a multiple-area selection. Read-only.

Borders

Returns a Borders collection that represents the borders of a style or a range of cells (including a range defined as part of a conditional format).

Cells

Returns a Range object that represents the cells in the specified range.

Characters

Returns a Characters object that represents a range of characters within the object text. You can use the Characters object to format characters within a text string.

Column

Returns the number of the first column in the first area in the specified range. Read-only Long.

Columns

Returns a Range object that represents the columns in the specified range.

ColumnWidth

Returns or sets the width of all columns in the specified range. Read/write Variant.

Comment

Returns a Comment object that represents the comment associated with the cell in the upper-left corner of the range.

Count

Returns a Long value that represents the number of objects in the collection.

CountLarge

Returns a value that represents the number of objects in the collection. Read-only Variant.

Creator

Returns a 32-bit integer that indicates the application in which this object was created. Read-only Long.

CurrentArray

If the specified cell is part of an array, returns a Range object that represents the entire array. Read-only.

CurrentRegion

Returns a Range object that represents the current region. The current region is a range bounded by any combination of blank rows and blank columns. Read-only.

Dependents

Returns a Range object that represents the range containing all the dependents of a cell. This can be a multiple selection (a union of Range objects) if there’s more than one dependent. Read-only Range object.

DirectDependents

Returns a Range object that represents the range containing all the direct dependents of a cell. This can be a multiple selection (a union of Range objects) if there’s more than one dependent. Read-only Range object.

DirectPrecedents

Returns a Range object that represents the range containing all the direct precedents of a cell. This can be a multiple selection (a union of Range objects) if there’s more than one precedent. Read-only Range object.

DisplayFormat

Returns a DisplayFormat object that represents the display settings for the specified range. Read-only

End

Returns a Range object that represents the cell at the end of the region that contains the source range. Equivalent to pressing END+UP ARROW, END+DOWN ARROW, END+LEFT ARROW, or END+RIGHT ARROW. Read-only Range object.

EntireColumn

Returns a Range object that represents the entire column (or columns) that contains the specified range. Read-only.

EntireRow

Returns a Range object that represents the entire row (or rows) that contains the specified range. Read-only.

Errors

Allows the user to to access error checking options.

Font

Returns a Font object that represents the font of the specified object.

FormatConditions

Returns a FormatConditions collection that represents all the conditional formats for the specified range. Read-only.

Formula

Returns or sets a Variant value that represents the object's formula in A1-style notation and in the macro language.

FormulaArray

Returns or sets the array formula of a range. Returns (or can be set to) a single formula or a Visual Basic array. If the specified range doesn't contain an array formula, this property returns null. Read/write Variant.

FormulaHidden

Returns or sets a Variant value that indicates if the formula will be hidden when the worksheet is protected.

FormulaLocal

Returns or sets the formula for the object, using A1-style references in the language of the user. Read/write Variant.

FormulaR1C1

Returns or sets the formula for the object, using R1C1-style notation in the language of the macro. Read/write Variant.

FormulaR1C1Local

Returns or sets the formula for the object, using R1C1-style notation in the language of the user. Read/write Variant.

HasArray

True if the specified cell is part of an array formula. Read-only Variant.

HasFormula

True if all cells in the range contain formulas; False if none of the cells in the range contains a formula; null otherwise. Read-only Variant.

Height

Returns or sets a Variant value that represents the height, in points, of the range.

Hidden

Returns or sets a Variant value that indicates if the rows or columns are hidden.

HorizontalAlignment

Returns or sets a Variant value that represents the horizontal alignment for the specified object.

Hyperlinks

Returns a Hyperlinks collection that represents the hyperlinks for the range.

ID

Returns or sets a String value that represents the identifying label for the specified cell when the page is saved as a Web page.

IndentLevel

Returns or sets a Variant value that represents the indent level for the cell or range. Can be an integer from 0 to 15.

Interior

Returns an Interior object that represents the interior of the specified object.

Item

Returns a Range object that represents a range at an offset to the specified range.

Left

Returns a Variant value that represents the distance, in points, from the left edge of column A to the left edge of the range.

ListHeaderRows

Returns the number of header rows for the specified range. Read-only Long.

ListObject

Returns a ListObject object for the Range object. Read-only ListObject object.

LocationInTable

Returns a constant that describes the part of the PivotTable report that contains the upper-left corner of the specified range. Can be one of the following XlLocationInTable. constants. Read-only Long.

Locked

Returns or sets a Variant value that indicates if the object is locked.

MDX

Returns the MDX name for the specified Range object. Read-only String.

MergeArea

Returns a Range object that represents the merged range containing the specified cell. If the specified cell isn’t in a merged range, this property returns the specified cell. Read-only Variant.

MergeCells

True if the range contains merged cells. Read/write Variant.

Name

Returns or sets a Variant value that represents the name of the object.

Next

Returns a Range object that represents the next cell.

NumberFormat

Returns or sets a Variant value that represents the format code for the object.

NumberFormatLocal

Returns or sets a Variant value that represents the format code for the object as a string in the language of the user.

Offset

Returns a Range object that represents a range that’s offset from the specified range.

Orientation

Returns or sets a Variant value that represents the text orientation.

OutlineLevel

Returns or sets the current outline level of the specified row or column. Read/write Variant.

PageBreak

Returns or sets the location of a page break. Can be one of the following XlPageBreak constants: xlPageBreakAutomatic, xlPageBreakManual, or xlPageBreakNone. Read/write Long.

Parent

Returns the parent object for the specified object. Read-only.

Phonetic

Returns the Phonetic object, which contains information about a specific phonetic text string in a cell.

Phonetics

Returns the Phonetics collection of the range. Read only.

PivotCell

Returns a PivotCell object that represents a cell in a PivotTable report.

PivotField

Returns a PivotField object that represents the PivotTable field containing the upper-left corner of the specified range.

PivotItem

Returns a PivotItem object that represents the PivotTable item containing the upper-left corner of the specified range.

PivotTable

Returns a PivotTable object that represents the PivotTable report containing the upper-left corner of the specified range.

Precedents

Returns a Range object that represents all the precedents of a cell. This can be a multiple selection (a union of Range objects) if there's more than one precedent. Read-only.

PrefixCharacter

Returns the prefix character for the cell. Read-only Variant.

Previous

Returns a Range object that represents the next cell.

QueryTable

Returns a QueryTable object that represents the query table that intersects the specified Range object.

Range

Returns a Range object that represents a cell or a range of cells.

ReadingOrder

Returns or sets the reading order for the specified object. Can be one of the following constants: xlRTL (right-to-left), xlLTR (left-to-right), or xlContext. Read/write Long.

Resize

Resizes the specified range. Returns a Range object that represents the resized range.

Row

Returns the number of the first row of the first area in the range. Read-only Long.

RowHeight

Returns or sets the height of the first row in the range specified, measured in points. Read/write Variant.

Rows

Returns a Range object that represents the rows in the specified range. Read-only Range object.

ServerActions

Specifies the actions that can be performed on the SharePoint server for a Range object.

ShowDetail

True if the outline is expanded for the specified range (so that the detail of the column or row is visible). The specified range must be a single summary column or row in an outline. Read/write Variant. For the PivotItem object (or the Range object if the range is in a PivotTable report), this property is set to True if the item is showing detail.

ShrinkToFit

Returns or sets a Variant value that indicates if text automatically shrinks to fit in the available column width.

SoundNote

This property should not be used. Sound notes have been removed from Microsoft Excel.

SparklineGroups

Returns a SparklineGroups object that represents an existing group of sparklines from the specified range. Read-only

Style

Returns or sets a Variant value, containing a Style object, that represents the style of the specified range.

Summary

True if the range is an outlining summary row or column. The range should be a row or a column. Read-only Variant.

Text

Returns or sets the text for the specified object. Read-only String.

Top

Returns a Variant value that represents the distance, in points, from the top edge of row 1 to the top edge of the range.

UseStandardHeight

True if the row height of the Range object equals the standard height of the sheet. Returns Null if the range contains more than one row and the rows aren’t all the same height. Read/write Variant.

UseStandardWidth

True if the column width of the Range object equals the standard width of the sheet. Returns null if the range contains more than one column and the columns aren’t all the same width. Read/write Variant.

Validation

Returns the Validation object that represents data validation for the specified range. Read-only.

Value

Returns or sets a Variant value that represents the value of the specified range.

Value2

Returns or sets the cell value. Read/write Variant.

VerticalAlignment

Returns or sets a Variant value that represents the vertical alignment of the specified object.

Width

Returns a Variant value that represents the width, in units, of the range.

Worksheet

Returns a Worksheet object that represents the worksheet containing the specified range. Read-only.

WrapText

Returns or sets a Variant value that indicates if Microsoft Excel wraps the text in the object.

XPath

Returns an XPath object that represents the Xpath of the element mapped to the specified Range object. The context of the range determines whether or not the action succeeds or returns an empty object. Read-only.