Skip to main content

TdxSpreadSheetDefinedName.Reference Property

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

Declaration

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