Show / Hide Table of Contents

Class ExcelCellBase

Base class containing cell address manipulating methods.

Inheritance
object
ExcelCellBase
ExcelAddressBase
Inherited Members
object.Equals(object)
object.Equals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
object.ReferenceEquals(object, object)
object.ToString()
Namespace: OfficeOpenXml
Assembly: EPPlus.dll
Syntax
public abstract class ExcelCellBase

Methods

GetAddress(int, bool, int, bool)

Returns the AlphaNumeric representation that Excel expects for a Cell Address

Declaration
public static string GetAddress(int Row, bool AbsoluteRow, int Column, bool AbsoluteCol)
Parameters
Type Name Description
int Row

The number of the row

bool AbsoluteRow

Absolute row

int Column

The number of the column in the worksheet

bool AbsoluteCol

Absolute column

Returns
Type Description
string

The cell address in the format A1

GetAddress(int, int)

Returns the AlphaNumeric representation that Excel expects for a Cell Address

Declaration
public static string GetAddress(int Row, int Column)
Parameters
Type Name Description
int Row

The number of the row

int Column

The number of the column in the worksheet

Returns
Type Description
string

The cell address in the format A1

GetAddress(int, int, bool)

Returns the AlphaNumeric representation that Excel expects for a Cell Address

Declaration
public static string GetAddress(int Row, int Column, bool Absolute)
Parameters
Type Name Description
int Row

The number of the row

int Column

The number of the column in the worksheet

bool Absolute

Get an absolute address ($A$1)

Returns
Type Description
string

The cell address in the format A1

GetAddress(int, int, int, int)

Returns the AlphaNumeric representation that Excel expects for a Cell Address

Declaration
public static string GetAddress(int FromRow, int FromColumn, int ToRow, int ToColumn)
Parameters
Type Name Description
int FromRow

From row number

int FromColumn

From column number

int ToRow

To row number

int ToColumn

From column number

Returns
Type Description
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

Declaration
public static string GetAddress(int FromRow, int FromColumn, int ToRow, int ToColumn, bool Absolute)
Parameters
Type Name Description
int FromRow

From row number

int FromColumn

From column number

int ToRow

To row number

int ToColumn

From column number

bool Absolute

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

Returns
Type Description
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

Declaration
public static string GetAddress(int FromRow, int FromColumn, int ToRow, int ToColumn, bool FixedFromRow, bool FixedFromColumn, bool FixedToRow, bool FixedToColumn)
Parameters
Type Name Description
int FromRow

From row number

int FromColumn

From column number

int ToRow

To row number

int ToColumn

From column number

bool FixedFromRow
bool FixedFromColumn
bool FixedToRow
bool FixedToColumn
Returns
Type Description
string

The cell address in the format A1

GetAddressCol(int, bool)

Get the columnn address for the column

Declaration
public static string GetAddressCol(int Col, bool Absolute = false)
Parameters
Type Name Description
int Col

The column

bool Absolute

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

Returns
Type Description
string

GetAddressRow(int, bool)

Get the row number in text

Declaration
public static string GetAddressRow(int Row, bool Absolute = false)
Parameters
Type Name Description
int Row

The row

bool Absolute

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

Returns
Type Description
string

GetColumnLetter(int)

Returns the character representation of the numbered column

Declaration
protected static string GetColumnLetter(int iColumnNumber)
Parameters
Type Name Description
int iColumnNumber

The number of the column

Returns
Type Description
string

The letter representing the column

GetColumnLetter(int, bool)

Returns the character representation of the numbered column

Declaration
protected static string GetColumnLetter(int iColumnNumber, bool fixedCol)
Parameters
Type Name Description
int iColumnNumber

The number of the column

bool fixedCol

True for fixed column

Returns
Type Description
string

The letter representing the column

GetFullAddress(string, string)

Get the full address including the worksheet name

Declaration
public static string GetFullAddress(string worksheetName, string address)
Parameters
Type Name Description
string worksheetName

The name of the worksheet

string address

The address

Returns
Type Description
string

The full address

GetFullAddress(string, string, string)

Get the full address including the worksheet name

Declaration
public static string GetFullAddress(string workbook, string worksheetName, string address)
Parameters
Type Name Description
string workbook

The workbook, if other than current

string worksheetName

The name of the worksheet

string address

The address

Returns
Type Description
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.

Declaration
public static bool IsSimpleAddress(string address)
Parameters
Type Name Description
string address

the address

Returns
Type Description
bool

True if valid.

IsValidAddress(string)

Returns true if the range or table address is valid

Declaration
public static bool IsValidAddress(string address)
Parameters
Type Name Description
string address

The address to check

Returns
Type Description
bool

Return true if the address is valid

IsValidCellAddress(string)

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

Declaration
public static bool IsValidCellAddress(string cellAddress)
Parameters
Type Name Description
string cellAddress

The alphanumeric cell address

Returns
Type Description
bool

True if the cell address is valid

IsValidRangeAddress(string)

Returns true if the range is valid

Declaration
public static bool IsValidRangeAddress(string address)
Parameters
Type Name Description
string address

The address to check

Returns
Type Description
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]]

Declaration
public static bool IsValidTableAddress(string address)
Parameters
Type Name Description
string address
Returns
Type Description
bool

TranslateFromR1C1(string, int, int)

Translates a R1C1 to an absolut address/Formula

Declaration
public static string TranslateFromR1C1(string value, int row, int col)
Parameters
Type Name Description
string value

Address

int row

Current row

int col

Current column

Returns
Type Description
string

The RC address

TranslateToR1C1(string, int, int)

Translates a absolut address to R1C1 Format

Declaration
public static string TranslateToR1C1(string value, int row, int col)
Parameters
Type Name Description
string value

R1C1 Address

int row

Current row

int col

Current column

Returns
Type Description
string

The absolut address/Formula

In this article
Back to top Generated by DocFX