NamedRange.Dependents Property (2007 System)
Gets a Range that represents the range containing all the 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 Dependents As Range
'Usage
Dim instance As NamedRange
Dim value As Range
value = instance.Dependents
[BrowsableAttribute(false)]
public Range Dependents { get; }
[BrowsableAttribute(false)]
public:
property Range^ Dependents {
Range^ get ();
}
public function get Dependents () : Range
Property Value
Type: Range
A Range that represents the range containing all the dependents of the NamedRange control.
Remarks
This property can return a multiple selection (a union of Range objects) if there is more than one dependent.
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 A1 to refer to the NamedRange. It then sets a reference in cell A2 to refer to cell A1. The code example then uses the Dependents property to select the dependents of the NamedRange, which are cells A1 and A2.
This example is for a document-level customization.
Private dependentsRange As Microsoft.Office.Tools.Excel.NamedRange
Private Sub SelectDependents()
dependentsRange = Me.Controls.AddNamedRange( _
Me.Range("B1"), "createMonthRange")
Me.dependentsRange.Value2 = "Smith"
Me.Range("A1").Value2 = "=" & _
Me.dependentsRange.Address(False, True, _
Excel.XlReferenceStyle.xlA1, False, )
Me.Range("A2").Value2 = "=A1"
Me.dependentsRange.Dependents.Select()
End Sub
Microsoft.Office.Tools.Excel.NamedRange dependentsRange;
private void SelectDependents()
{
dependentsRange = this.Controls.AddNamedRange(
this.Range["B1", missing], "createMonthRange");
this.dependentsRange.Value2 = "Smith";
this.Range["A1", missing].Value2 = "=" +
this.dependentsRange.Address[false, true,
Excel.XlReferenceStyle.xlA1, false, missing];
this.Range["A2", missing].Value2 = "=A1";
this.dependentsRange.Dependents.Select();
}
.NET Framework Security
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see Using Libraries from Partially Trusted Code.