NamedRange.RefersToLocal Property (2007 System)
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.v9.0 (in Microsoft.Office.Tools.Excel.v9.0.dll)
Syntax
'Declaration
<BrowsableAttribute(False)> _
Public Property RefersToLocal As String
'Usage
Dim instance As NamedRange
Dim value As String
value = instance.RefersToLocal
instance.RefersToLocal = value
[BrowsableAttribute(false)]
public string RefersToLocal { get; set; }
[BrowsableAttribute(false)]
public:
property String^ RefersToLocal {
String^ get ();
void set (String^ value);
}
public function get RefersToLocal () : String
public function set RefersToLocal (value : String)
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.
Remarks
Use the RefersToLocal property to change the range that a NamedRange control refers to.
Examples
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.
Private refersToLocalRange As Microsoft.Office.Tools.Excel.NamedRange
Private Sub DisplayFormulaLocal()
refersToLocalRange = Me.Controls.AddNamedRange( _
Me.Range("C1", "D2"), "refersToLocalRange")
MessageBox.Show(refersToLocalRange.RefersTo)
refersToLocalRange.RefersTo = "=Sheet1!$C$3"
refersToLocalRange.Select()
MessageBox.Show(refersToLocalRange.RefersTo)
End Sub
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);
}
.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.