The Parent property

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

 

You can execute each of the following statements in the Immediate window to check the parent’s name of each of these objects.

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

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

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

 

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 VatRate. The activated worksheet is the parent of the name range.

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