Expand Minimize

NamedRange.RefersToLocal Property

[This documentation is for preview only, and is subject to change in later releases. Blank topics are included as placeholders.]

Gets or sets the formula that the NamedRange control is defined to refer to, using A1-style notation in the language of the user.

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

string RefersToLocal { get; set; }

Property Value

Type: System.String
The formula that the NamedRange control is defined to refer to. The formula uses A1-style notation in the language of the user, and begins with an equal sign.

Use the RefersToLocal property to change the range that a NamedRange control refers to.

The following code example creates a NamedRange and displays the formula for the NamedRange in the language of the user. It then assigns a new cell to the NamedRange and displays the new formula.

This example is for a document-level customization.

Microsoft.Office.Tools.Excel.NamedRange refersToLocalRange;
private void DisplayFormulaLocal()
{
    refersToLocalRange = this.Controls.AddNamedRange(
         this.Range["C1", "D2"], "refersToLocalRange");
    MessageBox.Show(refersToLocalRange.RefersTo);
    refersToLocalRange.RefersTo = "=Sheet1!$C$3";
    refersToLocalRange.Select();
    MessageBox.Show(refersToLocalRange.RefersTo);
}

Was this page helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft