# NamedRangeDefinition Class

> NamedRangeDefinition class in the TX Sheet Control .NET API: Workbook or worksheet-scoped Excel formula name; refersTo retains Excel reference syntax.

- **Product:** TX Sheet Control
- **Section:** Documentation
- **Kind:** Class
- **Namespace:** `TXTextControl.TXSheetControl.Server`
- **Package:** `TXTextControl.TXSheetControl.Server` (assembly `TXTextControl.TXSheetControl.Api.dll`, from the private NuGet feed or the supplied NuGet folder)
- **Package:** `TXTextControl.TXSheetControl.Blazor` (assembly `TXTextControl.TXSheetControl.Api.dll`, from the private NuGet feed or the supplied NuGet folder)
- **Implements:** `System.IEquatable<TXTextControl.TXSheetControl.Server.NamedRangeDefinition>`
- **Path:** TX Sheet Control > API Reference > .NET API > TXTextControl.TXSheetControl.Server > NamedRangeDefinition Class
- **881 words**
- **Web URL:** https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/namedrangedefinition/
- **LLMs URL:** https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/namedrangedefinition/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/namedrangedefinition/llms-full.txt

---

Workbook or worksheet-scoped Excel formula name; refersTo retains Excel reference syntax.

### Syntax

```csharp
public class NamedRangeDefinition
```

Interfaces: `IEquatable<NamedRangeDefinition>`.

### Members

#### Constructors

| Constructor | Description |
|---|---|
| [Constructor](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/namedrangedefinition/constructor/llms-full.txt) |  |

#### Properties

| Property | Description |
|---|---|
| [Comment](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/namedrangedefinition/comment-property/llms-full.txt) |  |
| [Hidden](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/namedrangedefinition/hidden-property/llms-full.txt) |  |
| [Name](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/namedrangedefinition/name-property/llms-full.txt) |  |
| [RefersTo](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/namedrangedefinition/refersto-property/llms-full.txt) |  |
| [SheetId](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/namedrangedefinition/sheetid-property/llms-full.txt) |  |

### Examples

Obtain NamedRangeDefinition from a real document operation. Return the detached result to the calling report, API response or application.

```csharp
using TXTextControl.TXSheetControl.Server;

async Task<NamedRangeDefinition> ReadReportNamedRangeDefinitionAsync(ServerSheetControl control)
{
    var book = control.Workbook;
    var sheet = await book.Sheets.AtAsync(0);
    await sheet.Cell("B8").SetValueAsync(120);
    await sheet.Cell("B9").SetValueAsync(80);
    await sheet.Cell("B10").SetFormulaAsync("=SUM(B8:B9)");
    await book.Names.SetAsync("InvoiceTotal", "='" + (await sheet.GetNameAsync()).Replace("'", "''") + "'!$B$10");

    var result = await book.Names.GetAsync("InvoiceTotal");
    return result;
}
```

### See Also

- [TXTextControl.TXSheetControl.Server Namespace](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/llms-full.txt)
- [Workbooks and Worksheets](https://docs.textcontrol.com/tx-sheet-control/spreadsheets/workbooks/llms-full.txt)

---

## In This Section

- [NamedRangeDefinition.Comment Property](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/namedrangedefinition/comment-property/llms-full.txt): NamedRangeDefinition.Comment property in the TX Sheet Control .NET API, with its syntax, its type string? and a C# example.
- [NamedRangeDefinition Constructor](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/namedrangedefinition/constructor/llms-full.txt): NamedRangeDefinition constructor in the TX Sheet Control .NET API, with its syntax, a C# example and remarks on awaiting tasks and handles.
- [NamedRangeDefinition.Hidden Property](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/namedrangedefinition/hidden-property/llms-full.txt): NamedRangeDefinition.Hidden property in the TX Sheet Control .NET API, with its syntax, its type bool, a C# example and remarks on awaiting tasks and handles.
- [NamedRangeDefinition.Name Property](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/namedrangedefinition/name-property/llms-full.txt): NamedRangeDefinition.Name property in the TX Sheet Control .NET API, with its syntax, its type string, a C# example and remarks on awaiting tasks and handles.
- [NamedRangeDefinition.RefersTo Property](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/namedrangedefinition/refersto-property/llms-full.txt): NamedRangeDefinition.RefersTo property in the TX Sheet Control .NET API, with its syntax, its type string and a C# example.
- [NamedRangeDefinition.SheetId Property](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/namedrangedefinition/sheetid-property/llms-full.txt): NamedRangeDefinition.SheetId property in the TX Sheet Control .NET API, with its syntax, its type string? and a C# example.

---

## Nearby

- **Previous:** [NameCollection.SetAsync Method](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/namecollection/setasync-method/llms-full.txt)
- **Next:** [NamedRangeDefinition Constructor](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/namedrangedefinition/constructor/llms-full.txt)
