Partilhar via


XmlMappedRange.Precedents Property

Gets a Range that represents all the precedents of the XmlMappedRange control.

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

Syntax

'Declaration
ReadOnly Property Precedents As Range
Range Precedents { get; }

Property Value

Type: Microsoft.Office.Interop.Excel.Range
A Range that represents all the precedents of the XmlMappedRange control.

Remarks

This can be a multiple selection (a union of Range objects) if there is more than one precedent.

Examples

The following code example sets a reference in cell A2 to refer to cell A1, and then sets a reference in an XmlMappedRange to refer to cell A2. The code example then uses the Precedents property to select the precedents of the XmlMappedRange, which are cells A1 and A2. This code example assumes that the current worksheet contains an XmlMappedRange named CustomerAddress1Cell with a corresponding schema element of type int.

Private Sub SelectPrecedents()
    Me.Range("A1").Value2 = "1710" 
    Me.Range("A2").Value2 = "=A1" 

    Me.CustomerAddress1Cell.Value2 = "=A2" 
    Me.CustomerAddress1Cell.Precedents.Select()
End Sub
private void SelectPrecedents()
{
    this.Range["A1"].Value2 = "1710";
    this.Range["A2"].Value2 = "=A1";

    this.CustomerAddress1Cell.Value2 = "=A2";
    this.CustomerAddress1Cell.Precedents.Select();
}

.NET Framework Security

See Also

Reference

XmlMappedRange Interface

Microsoft.Office.Tools.Excel Namespace