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

TdxSpreadSheetDefinedName.Reference Property

Specifies a reference to a cell object, cell range, formula expression, and/or constant.

#Declaration

Delphi
property Reference: string read; write;

#Property Value

Type
string

#Remarks

Use this property to change a target to which the defined name refers without changing its caption. The reference string contains the equals sign (=) followed by the worksheet’s caption and the target cell (or cell area) name, delimited by an exclamation mark. If the sheet name is omitted, the Spreadsheet Control automatically completes the reference with the active sheet’s name:

//...
  dxSpreadSheet1.AddSheet();
// Assigning the reference to the A1 cell of the 'Sheet2' worksheet.
  dxSpreadSheet1.DefinedNames[0].Reference := '=Sheet2!A1';
// If the sheet name is omitted, the currently active sheet name is
// assigned as a part of the reference to the A1 cell
  dxSpreadSheet1.DefinedNames[0].Reference := '=A1';

Note

The cells name used in the Reference property depends on the value of the spreadsheet’s OptionsView.R1C1Reference property. For instance, if OptionsView.R1C1Reference is set to True, the name of the cell belonging to both the first column and the first row is 11 instead of A1.

See Also