Create Workbook (Global) and Worksheet Scoped Named Ranges
Contents
[
Hide
]
Microsoft Excel allows users to define named ranges with two different scopes: workbook (also known as global scope) and worksheet.
- Named ranges with a workbook scope can be accessed from any worksheet within that workbook by simply using its name.
- Worksheet scoped named ranges are accessed with the reference of the particular worksheet in which it was created.
Aspose.Cells provides the same functionality as Microsoft Excel for adding workbook and worksheet scoped named ranges. When creating a worksheet scoped named range, the worksheet reference should be used in the named range to specify it as a worksheet scoped named range.
The following code samples show how to create workbook and worksheet scoped name ranges by using the Range class.
Adding a Named Range with Workbook Scope
Adding a Named Range with Worksheet Scope