Search Results for

    Show / Hide Table of Contents

    ExcelFile.GetCellFormat Method

    Overloads

    • ExcelFile.GetCellFormat(Int32, Int32)
    • ExcelFile.GetCellFormat(Int32, Int32, Int32)

    ExcelFile.GetCellFormat(Int32, Int32)

    Cell Format for a given cell This method gets the Format number (XF) of a cell. You can create new formats using the 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 GetCellVisibleFormat(Int32, Int32)

    Syntax

    Namespace: FlexCel.Core

    public abstract Int32 GetCellFormat(Int32 row, Int32 col)

    Parameters

    <-> Parameter Type Description
    row Int32 Row Index (1 based)
    col Int32 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

    • ExcelFile
    • AddFormat
    • SetCellFormat(Int32, Int32, Int32)
    • GetFormat
    • GetCellVisibleFormat(Int32, Int32)

    ExcelFile.GetCellFormat(Int32, Int32, Int32)

    Cell Format for a given cell This method gets the Format number (XF) of a cell. You can create new formats using the 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 GetCellVisibleFormat(Int32, Int32)

    Syntax

    Namespace: FlexCel.Core

    public abstract Int32 GetCellFormat(Int32 sheet, Int32 row, Int32 col)

    Parameters

    <-> Parameter Type Description
    sheet Int32 Sheet index (1 based).
    row Int32 Row Index (1 based)
    col Int32 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

    • ExcelFile
    • AddFormat
    • SetCellFormat(Int32, Int32, Int32)
    • GetFormat
    • GetCellVisibleFormat(Int32, Int32)
    In This Article
    Back to top FlexCel Studio for the .NET Framework v7.24.0.0
    © 2002 - 2025 tmssoftware.com