Table of Contents

Class ExcelCellBase

Namespace
OfficeOpenXml
Assembly
EPPlus.dll

Base class containing cell address manipulating methods.

public abstract class ExcelCellBase
Inheritance
ExcelCellBase
Derived
Inherited Members

Constructors

ExcelCellBase()

protected ExcelCellBase()

Methods

GetAddress(int, bool, int, bool)

Returns the AlphaNumeric representation that Excel expects for a Cell Address

public static string GetAddress(int Row, bool AbsoluteRow, int Column, bool AbsoluteCol)

Parameters

Row int

The number of the row

AbsoluteRow bool

Absolute row

Column int

The number of the column in the worksheet

AbsoluteCol bool

Absolute column

Returns

string

The cell address in the format A1

GetAddress(int, int)

Returns the AlphaNumeric representation that Excel expects for a Cell Address

public static string GetAddress(int Row, int Column)

Parameters

Row int

The number of the row

Column int

The number of the column in the worksheet

Returns

string

The cell address in the format A1

GetAddress(int, int, bool)

Returns the AlphaNumeric representation that Excel expects for a Cell Address

public static string GetAddress(int Row, int Column, bool Absolute)

Parameters

Row int

The number of the row

Column int

The number of the column in the worksheet

Absolute bool

Get an absolute address ($A$1)

Returns

string

The cell address in the format A1

GetAddress(int, int, int, int)

Returns the AlphaNumeric representation that Excel expects for a Cell Address

public static string GetAddress(int FromRow, int FromColumn, int ToRow, int ToColumn)

Parameters

FromRow int

From row number

FromColumn int

From column number

ToRow int

To row number

ToColumn int

From column number

Returns

string

The cell address in the format A1

GetAddress(int, int, int, int, bool)

Returns the AlphaNumeric representation that Excel expects for a Cell Address

public static string GetAddress(int FromRow, int FromColumn, int ToRow, int ToColumn, bool Absolute)

Parameters

FromRow int

From row number

FromColumn int

From column number

ToRow int

To row number

ToColumn int

From column number

Absolute bool

if true address is absolute (like $A$1)

Returns

string

The cell address in the format A1

GetAddress(int, int, int, int, bool, bool, bool, bool)

Returns the AlphaNumeric representation that Excel expects for a Cell Address

public static string GetAddress(int FromRow, int FromColumn, int ToRow, int ToColumn, bool FixedFromRow, bool FixedFromColumn, bool FixedToRow, bool FixedToColumn)

Parameters

FromRow int

From row number

FromColumn int

From column number

ToRow int

To row number

ToColumn int

From column number

FixedFromRow bool
FixedFromColumn bool
FixedToRow bool
FixedToColumn bool

Returns

string

The cell address in the format A1

GetAddressCol(int, bool)

Get the columnn address for the column

public static string GetAddressCol(int Col, bool Absolute = false)

Parameters

Col int

The column

Absolute bool

If the column is absolute. Adds a $ before the address if true

Returns

string

GetAddressRow(int, bool)

Get the row number in text

public static string GetAddressRow(int Row, bool Absolute = false)

Parameters

Row int

The row

Absolute bool

If the row is absolute. Adds a $ before the address if true

Returns

string

GetColumnLetter(int)

Returns the character representation of the numbered column

protected static string GetColumnLetter(int iColumnNumber)

Parameters

iColumnNumber int

The number of the column

Returns

string

The letter representing the column

GetColumnLetter(int, bool)

Returns the character representation of the numbered column

protected static string GetColumnLetter(int iColumnNumber, bool fixedCol)

Parameters

iColumnNumber int

The number of the column

fixedCol bool

True for fixed column

Returns

string

The letter representing the column

GetFullAddress(string, string)

Get the full address including the worksheet name

public static string GetFullAddress(string worksheetName, string address)

Parameters

worksheetName string

The name of the worksheet

address string

The address

Returns

string

The full address

GetFullAddress(string, string, string)

Get the full address including the worksheet name

public static string GetFullAddress(string workbook, string worksheetName, string address)

Parameters

workbook string

The workbook, if other than current

worksheetName string

The name of the worksheet

address string

The address

Returns

string

The full address

IsSimpleAddress(string)

If the address is a address is a cell or range address of format A1 or A1:A2, without specified worksheet name.

public static bool IsSimpleAddress(string address)

Parameters

address string

the address

Returns

bool

True if valid.

IsValidAddress(string)

Returns true if the range or table address is valid

public static bool IsValidAddress(string address)

Parameters

address string

The address to check

Returns

bool

Return true if the address is valid

IsValidCellAddress(string)

Checks that a cell address (e.g. A5) is valid.

public static bool IsValidCellAddress(string cellAddress)

Parameters

cellAddress string

The alphanumeric cell address

Returns

bool

True if the cell address is valid

IsValidRangeAddress(string)

Returns true if the range is valid

public static bool IsValidRangeAddress(string address)

Parameters

address string

The address to check

Returns

bool

Return true if the address is valid

IsValidTableAddress(string)

Returns true if the address is a valid table address. I.e table1[], table1[[#this row],[column1]]

public static bool IsValidTableAddress(string address)

Parameters

address string

Returns

bool

TranslateFromR1C1(string, int, int)

Translates a R1C1 to an absolut address/Formula

public static string TranslateFromR1C1(string value, int row, int col)

Parameters

value string

Address

row int

Current row

col int

Current column

Returns

string

The RC address

TranslateToR1C1(string, int, int)

Translates a absolut address to R1C1 Format

public static string TranslateToR1C1(string value, int row, int col)

Parameters

value string

R1C1 Address

row int

Current row

col int

Current column

Returns

string

The absolut address/Formula