TdxSpreadSheetDefinedNames.AddFromSelection(TdxSpreadSheetTableView,TRect,TcxBorders) Method
Creates new defined names from the specified cell range in a target worksheet.
Declaration
procedure AddFromSelection(AView: TdxSpreadSheetTableView; const ASelectedArea: TRect; AHeaders: TcxBorders); overload;
Parameters
Name | Type | Description |
---|---|---|
AView | TdxSpreadSheetTableView | A target worksheet. |
ASelectedArea | TRect | A cell range. |
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:
The corner source cell (‘Corner’) creates a defined name that refers to a rectangular area rather than a column or row.
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.