NativeExcel for .Net Developer's Reference

IName.RefersTo Property

Gets or sets the formula that the name is defined to refer to, in A1-style notation, beginning with an equal sign.

[Visual Basic]

Property Value

A string containing the formula that the name is defined to refer to (using A1-style notation).


The RefersTo must be specified in A1-style notation, including dollar signs ($) where appropriate. For example, if cell A10 is selected on Sheet1 and you define a name by using the RefersTo argument "=sheet1!A1:B1", the new name actually refers to cells A10:B10 because you specified a relative reference). To specify an absolute reference, use "=sheet1!$A$1:$B$1".


This example changes the formula for "MyName" defined name of the workbook.

INames names = Workbook.Worksheets[1].Names;
if (names["MyName"] != null) names["MyName"].RefersTo = "=Sheet1!$A$1";
Dim names As INames = Workbook.Worksheets(1).Names
If Not names("MyName") Is Nothing Then
   names("MyName").RefersTo = "=Sheet1!$A$1"
End If 
INames* names = Workbook->Worksheets->Item[1]->Names;
if (names->Item[S"MyName"] != null) 
   names->Item["MyName"]->RefersTo = S"=Sheet1!$A$1";

See Also

IName Interface | NativeExcel Namespace