Skip to main content

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

TdxSpreadSheetDefinedNames.AddFromSelection(TdxSpreadSheetTableView,TdxRectList,TcxBorders) Method

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

#Declaration

Delphi
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