Skip to main content

Range.Parent property

Table of contents
  1. Syntax
  2. Remarks
  3. Examples

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

Syntax

expression.Parent

expression A variable that represents a Range object.

Remarks

The Parent property of an object returns the parent object of the object. For example, the parent of a Range object is a Worksheet object. The parent of a Worksheet object is a Workbook object. The parent of a Workbook is the Application object. The hierarchy below for a Range object summaries the discussed idea of the Parent property:

Application object > Workbook object > Worksheet object > Range object

Sometimes, the range that you are working with might not be in the active sheet. To access certain property and method of the worksheet, the Parent property of the Range object comes in handy. For example, the following statement activates the worksheet of a range named ProductsID. The activated worksheet is the parent of the name range.

Names("ProductsID").RefersToRange.Parent.Activate

Examples

Debug.Print Range("A1").Parent.Name 'Returns the name of the active sheet

Debug.Print Range("A1").Parent.Parent.Name 'Returns the name of the active workbook

Debug.Print Range("A1").Parent.Parent.Parent.Name 'Returns Microsoft Excel

Leave a comment

Your email address will not be published. Required fields are marked *

Format your code: <pre><code class="language-vba">place your code here</code></pre>