RefersToRange Property

Applies To

Name Object.

Description

Returns the Range object referred to by a Name object. This property is available only in Microsoft Excel for Windows 95. Read-only.

Remarks

If the Name object doesn't refer to a range (for example, if the Name object refers to a constant or a formula), this property fails.

To change the range that a name refers to, use the RefersTo property.

See Also

RefersTo Property, RefersToR1C1 Property.

Example

This example displays the number of rows and columns in the print area on the active worksheet.


p = Names("Print_Area").RefersToRange.Value
MsgBox "Print_Area: " & UBound(p, 1) & " rows, " & _
    UBound(p, 2) & " columns"

    UBound(p, 2) & " columns"