NamedRange.DirectDependents Property (2007 System)

Gets a Range that represents the range containing all the direct dependents of the NamedRange control.

Namespace:  Microsoft.Office.Tools.Excel
Assembly:  Microsoft.Office.Tools.Excel.v9.0 (in Microsoft.Office.Tools.Excel.v9.0.dll)

Syntax

'Declaration
<BrowsableAttribute(False)> _
Public ReadOnly Property DirectDependents As Range
'Usage
Dim instance As NamedRange 
Dim value As Range 

value = instance.DirectDependents
[BrowsableAttribute(false)]
public Range DirectDependents { get; }
[BrowsableAttribute(false)]
public:
property Range^ DirectDependents {
    Range^ get ();
}
public function get DirectDependents () : Range

Property Value

Type: Range
A Range that represents the range containing all the direct dependents of the NamedRange control.

Remarks

This property only works on the active sheet and cannot trace remote references.

Examples

The following code example creates a NamedRange and sets a reference in cell C1 to refer to the NamedRange. It then sets a reference in cell C2 to refer to cell C1. The code example then uses the DirectDependents property to select the direct dependent of the NamedRange, which is cell C1.

This example is for a document-level customization.

Private directDependentsRange As Microsoft.Office.Tools.Excel.NamedRange

Private Sub SelectDirectDependents()
    directDependentsRange = Me.Controls.AddNamedRange( _
        Me.Range("B1"), "createMonthRange")
    Me.directDependentsRange.Value2 = "Smith" 
    Me.Range("C1").Value2 = "=" & _
        Me.directDependentsRange.Address(False, True, _
        Excel.XlReferenceStyle.xlA1, False, )

    Me.Range("C2").Value2 = "=C1" 
    Me.directDependentsRange.DirectDependents.Select()
End Sub
Microsoft.Office.Tools.Excel.NamedRange directDependentsRange;
private void SelectDirectDependents()
{
    directDependentsRange = this.Controls.AddNamedRange(
        this.Range["B1", missing], "createMonthRange");
    this.directDependentsRange.Value2 = "Smith";
    this.Range["C1", missing].Value2 = "=" +
        this.directDependentsRange.Address[false, true,
        Excel.XlReferenceStyle.xlA1, false, missing];

    this.Range["C2", missing].Value2 = "=C1";
    this.directDependentsRange.DirectDependents.Select();
}

.NET Framework Security

See Also

Reference

NamedRange Class

NamedRange Members

Microsoft.Office.Tools.Excel Namespace