[]
Defines a new name. Returns the IName object.
Uses A1-style notation in refersTo to define what the name refers to,
such as a cell, range, formula, or constant.
IName Add(string name, string refersTo)
Function Add(name As String, refersTo As String) As IName
| Type | Name | Description |
|---|---|---|
| string | name | The text to use as the name. Names cannot include spaces and cannot look like cell references. |
| string | refersTo | The A1-style reference string that describes what the name refers to. |
| Type | Description |
|---|---|
| IName | Returns a new IName object. |
INames names = worksheet.Names;
worksheet.Range["A1:B3"].Value = new object[,] {
{ "Name", "Value" },
{ "Test", 100 },
{ "Total", 200 }
};
IName salesData = names.Add("SalesData", "=A1:B3");