GemBox.Spreadsheet
  • Overview
  • Examples
  • Free version
  • Support
  • Pricelist

    Show / Hide Table of Contents

    NamedRangeCollection Class

    Namespace:
    GemBox.Spreadsheet
    Assembly:
    GemBox.Spreadsheet.dll

    Collection of the descriptive names which are used to represent cells, ranges of cells, formulas, or constant values.

    • C#
    • VB.NET
    public sealed class NamedRangeCollection : IEnumerable<NamedRange>, IEnumerable
    Public NotInheritable Class NamedRangeCollection
        Implements IEnumerable(Of NamedRange), IEnumerable
    Inheritance:
    System.Object
    NamedRangeCollection
    Implements
    System.Collections.Generic.IEnumerable<NamedRange>
    System.Collections.IEnumerable
    Remarks

    You can use the labels of columns and rows on a worksheet to refer to the cells within those columns and rows. Or you can create descriptive names to represent cells, ranges of cells, formulas, or constant values. Labels can be used in formulas that refer to data on the same worksheet; if you want to represent a range on another worksheet, use a name. You can also create 3-D names that represent the same cell or range of cells across multiple worksheets.

    Properties

    Count

    Gets the number of named ranges contained in the collection.

    • C#
    • VB.NET
    public int Count { get; }
    Public ReadOnly Property Count As Integer
    Property Value
    System.Int32

    Item[Int32]

    Gets the NamedRange at the specified index.

    • C#
    • VB.NET
    public NamedRange this[int index] { get; }
    Public ReadOnly Property Item(index As Integer) As NamedRange
    Parameters
    index
    System.Int32

    Range index.

    Property Value
    NamedRange

    Item[String]

    Gets the NamedRange with the specified name.

    • C#
    • VB.NET
    public NamedRange this[string name] { get; }
    Public ReadOnly Property Item(name As String) As NamedRange
    Parameters
    name
    System.String

    Range name.

    Property Value
    NamedRange

    Methods

    Add(String, CellRange)

    Adds a new named range. Named ranges are used to represent cells, ranges of cells, formulas or constant values.

    • C#
    • VB.NET
    public void Add(string name, CellRange range)
    Public Sub Add(name As String, range As CellRange)
    Parameters
    name
    System.String

    The user-defined name.

    range
    CellRange

    The range to be referred by name.

    Remarks

    You can use the labels of columns and rows on a worksheet to refer to the cells within those columns and rows. Or you can create descriptive names to represent cells, ranges of cells, formulas, or constant values. Labels can be used in formulas that refer to data on the same worksheet; if you want to represent a range on another worksheet, use a name. You can also create 3-D names that represent the same cell or range of cells across multiple worksheets.

    See Also
    Formula

    Add(String, CellRange, Boolean)

    Adds a new named range. Named ranges are used to represent cells, ranges of cells, formulas or constant values.

    • C#
    • VB.NET
    public void Add(string name, CellRange range, bool globalName)
    Public Sub Add(name As String, range As CellRange, globalName As Boolean)
    Parameters
    name
    System.String

    The user-defined name.

    range
    CellRange

    The range to be referred by name.

    globalName
    System.Boolean

    sets the range as global if set to true

    Remarks

    You can use the labels of columns and rows on a worksheet to refer to the cells within those columns and rows. Or you can create descriptive names to represent cells, ranges of cells, formulas, or constant values. Labels can be used in formulas that refer to data on the same worksheet; if you want to represent a range on another worksheet, use a name. You can also create 3-D names that represent the same cell or range of cells across multiple worksheets.

    See Also
    Formula

    GetEnumerator()

    Returns an enumerator that can iterate through a collection.

    • C#
    • VB.NET
    public IEnumerator<NamedRange> GetEnumerator()
    Public Function GetEnumerator As IEnumerator(Of NamedRange)
    Returns
    System.Collections.Generic.IEnumerator<NamedRange>

    An System.Collections.Generic.IEnumerator<T> that can be used to iterate through the collection.

    SetPrintArea(CellRange)

    Sets print area.

    • C#
    • VB.NET
    public void SetPrintArea(CellRange range)
    Public Sub SetPrintArea(range As CellRange)
    Parameters
    range
    CellRange

    Range of cells that we want set as print area.

    Remarks

    If specified, print area is used when exporting to HTML, PDF, XPS, and image formats as cell range which will be exported in the output file format.

    SetPrintArea(CellRange[])

    Sets multi-range print area.

    Multi-range print area is currently supported in XLSX only.

    • C#
    • VB.NET
    public void SetPrintArea(params CellRange[] ranges)
    Public Sub SetPrintArea(ParamArray ranges As CellRange())
    Parameters
    ranges
    CellRange[]

    Ranges of cells that we want set as print area.

    Remarks

    If specified, print area is used when exporting to HTML, PDF, XPS, and image formats as cell range which will be exported in the output file format.

    SetPrintArea(IEnumerable<CellRange>)

    Sets multi-range print area.

    Multi-range print area is currently supported in XLSX only.

    • C#
    • VB.NET
    public void SetPrintArea(IEnumerable<CellRange> ranges)
    Public Sub SetPrintArea(ranges As IEnumerable(Of CellRange))
    Parameters
    ranges
    System.Collections.Generic.IEnumerable<CellRange>

    Ranges of cells that we want set as print area.

    Remarks

    If specified, print area is used when exporting to HTML, PDF, XPS, and image formats as cell range which will be exported in the output file format.

    SetPrintTitles(ExcelColumn, Int32)

    Sets print titles (columns to repeat at left).

    • C#
    • VB.NET
    public void SetPrintTitles(ExcelColumn startColumn, int numberOfColumns)
    Public Sub SetPrintTitles(startColumn As ExcelColumn, numberOfColumns As Integer)
    Parameters
    startColumn
    ExcelColumn

    First column.

    numberOfColumns
    System.Int32

    Number of columns that repeat.

    SetPrintTitles(ExcelColumnRowBase, Int32, ExcelColumnRowBase, Int32)

    Sets print titles.

    • C#
    • VB.NET
    public void SetPrintTitles(ExcelColumnRowBase startRow, int numberOfRows, ExcelColumnRowBase startColumn, int numberOfColumns)
    Public Sub SetPrintTitles(startRow As ExcelColumnRowBase, numberOfRows As Integer, startColumn As ExcelColumnRowBase, numberOfColumns As Integer)
    Parameters
    startRow
    ExcelColumnRowBase

    First row.

    numberOfRows
    System.Int32

    Number of rows that repeat.

    startColumn
    ExcelColumnRowBase

    First column.

    numberOfColumns
    System.Int32

    Number of columns that repeat.

    SetPrintTitles(ExcelRow, Int32)

    Sets print titles (rows to repeat at top).

    • C#
    • VB.NET
    public void SetPrintTitles(ExcelRow startRow, int numberOfRows)
    Public Sub SetPrintTitles(startRow As ExcelRow, numberOfRows As Integer)
    Parameters
    startRow
    ExcelRow

    First row.

    numberOfRows
    System.Int32

    Number of rows that repeat.

    Implements

    System.Collections.Generic.IEnumerable<T>
    System.Collections.IEnumerable

    See Also

    Formula
    Back to top

    Facebook • Twitter • LinkedIn

    © GemBox Ltd. — All rights reserved.