TXlsFile.GetCellFormat Method
Overloads
TXlsFile.GetCellFormat(Integer, Integer)
Cell Format for a given cell This method gets the Format number (XF) of a cell. You can create new formats using the TExcelFile.AddFormat function.
Remarks
This method DOES NOT return the format for an empty cell, even if it has a column or a row format. For the visible format of the cell, see TExcelFile.GetCellVisibleFormat(Integer, Integer)
Syntax
Unit: FlexCel.XlsAdapter
function TXlsFile.GetCellFormat(const row: Integer; const col: Integer): Integer; overload; override;
Parameters
<-> | Parameter | Type | Description |
---|---|---|---|
const | row | Integer | Row Index (1 based) |
const | col | Integer | Column Index (1 based) |
Returns
XF for the cell.
Examples
To copy the format on cell A1 to B2 you should write:
xls.SetCellFormat(2, 2, xls.GetCellFormat(1, 1));
See also
- TXlsFile
- TExcelFile.AddFormat
- TExcelFile.SetCellFormat(Integer, Integer, Integer)
- TExcelFile.GetFormat
- TExcelFile.GetCellVisibleFormat(Integer, Integer)
TXlsFile.GetCellFormat(Integer, Integer, Integer)
Cell Format for a given cell This method gets the Format number (XF) of a cell. You can create new formats using the TExcelFile.AddFormat function.
Remarks
This method DOES NOT return the format for an empty cell, even if it has a column or a row format. For the visible format of the cell, see TExcelFile.GetCellVisibleFormat(Integer, Integer)
Syntax
Unit: FlexCel.XlsAdapter
function TXlsFile.GetCellFormat(const sheet: Integer; const row: Integer; const col: Integer): Integer; overload; override;
Parameters
<-> | Parameter | Type | Description |
---|---|---|---|
const | sheet | Integer | Sheet index (1 based). |
const | row | Integer | Row Index (1 based) |
const | col | Integer | Column Index (1 based) |
Returns
XF for the cell.
Examples
To copy the format on cell A1 to B2 you should write:
xls.SetCellFormat(2, 2, xls.GetCellFormat(1, 1));