Skip to main content
All docs
V25.1
  • TdxSpreadSheetDefinedNames.AddFromSelection(TdxSpreadSheetTableView,TdxRectList,TcxBorders) Method

    Creates new defined names from the specified cell ranges in a target worksheet.

    Declaration

    procedure AddFromSelection(AView: TdxSpreadSheetTableView; ASelectedAreas: TdxRectList; AHeaders: TcxBorders); overload;

    Parameters

    Name Type Description
    AView TdxSpreadSheetTableView

    The target worksheet.

    ASelectedAreas TdxRectList

    The list of target cell ranges.

    AHeaders TcxBorders

    Source cells for defined name identifiers.

    Remarks

    The number of created defined names depends on the selected cell range and position of cells with defined name identifiers. For instance, an AddFromSelection procedure call creates seven defined names from the following selected cell range if the left column and top row store defined name identifiers:

    VCL Spreadsheet: A Source Example

    Note

    The corner source cell ('Corner') creates a defined name that refers to a rectangular area rather than a column or row.

    VCL Spreadsheet: Generated Defined Names

    The AddFromSelection procedure validates defined name identifiers and attempts to append an underscore character to each invalid identifier. If such an identifier remains invalid, an AddFromSelection procedure call creates no corresponding defined name.

    Note

    You can link a UI element to the CreateDefinedNamesFromSelection command to allow users to create defined names from cell selection.

    See Also