HotXLS Docs

método Add

Defines new nombre. Devuelve un IXLSName interfaz

Sintaxis

función agregar(nombre: Widestring; RefersTo: Widestring): IXLSName;
función agregar(nombre: Widestring; RefersTo: Widestring; Visible: Booleano): IXLSName;
función agregar(nombre: Widestring; SheetName: Widestring; fila: Entero; Col: Entero): IXLSName;
función agregar(nombre: Widestring; SheetName: Widestring; Row1: Entero; Col1: Entero; Row2: Entero; Col2: Entero): IXLSName;
Name Required Widestring. texto use as nombre. Names cannot include spaces y cannot look like celda references
RefersTo Required Widestring. Describes what nombre refers (usando A1-estilo notación)
Visible Optional Booleano. True define nombre normally. False define nombre as hidden nombre (que es, it doesn't appear en either Define nombre, Paste nombre, o Goto dialog box). valor predeterminado es True
SheetName Required Widestring. hoja de cálculo que owns target celda o rango
Row Required Entero. uno-basado fila para single-celda target
Col Required Entero. uno-basado columna para single-celda target
Row1, Col1, Row2, Col2 Required Integers. uno-basado fila y columna coordinates para rectangular target rango

Ejemplo

Este ejemplo agrega new defined nombre para libro y use este nombre en el celda fórmula

Workbook.Names.Add('MyName','=Sheet1!$F$10:$H$20');
Workbook.Sheets[1].Cells[3,4].Formula := '=SUM(MyName)';
Este ejemplo creates single-celda y rango names desde hoja de cálculo coordinates

Workbook.Names.Add('InputCell','Sheet1',2,3);
Workbook.Names.Add('InputBlock','Sheet1',4,2,6,5);
Este ejemplo agrega new defined nombre para hoja de cálculo uno y use este nombre en el celda fórmula

Workbook.Sheets[1].Names.Add('MyName','=Sheet1!$F$10:$H$20');
Workbook.Sheets[2].Cells[3,4].Formula := '=SUM(Sheet1!MyName)';

Véase también