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(Int32, Boolean, Int32, Boolean)

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
Int32 Row

The number of the row

Boolean AbsoluteRow

Absolute row

Int32 Column

The number of the column in the worksheet

Boolean AbsoluteCol

Absolute column

Returns
Type Description
String

The cell address in the format A1

GetAddress(Int32, Int32)

Returns the AlphaNumeric representation that Excel expects for a Cell Address

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

The number of the row

Int32 Column

The number of the column in the worksheet

Returns
Type Description
String

The cell address in the format A1

GetAddress(Int32, Int32, Boolean)

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
Int32 Row

The number of the row

Int32 Column

The number of the column in the worksheet

Boolean Absolute

Get an absolute address ($A$1)

Returns
Type Description
String

The cell address in the format A1

GetAddress(Int32, Int32, Int32, Int32)

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
Int32 FromRow

From row number

Int32 FromColumn

From column number

Int32 ToRow

To row number

Int32 ToColumn

From column number

Returns
Type Description
String

The cell address in the format A1

GetAddress(Int32, Int32, Int32, Int32, Boolean)

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
Int32 FromRow

From row number

Int32 FromColumn

From column number

Int32 ToRow

To row number

Int32 ToColumn

From column number

Boolean Absolute

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

Returns
Type Description
String

The cell address in the format A1

GetAddress(Int32, Int32, Int32, Int32, Boolean, Boolean, Boolean, Boolean)

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
Int32 FromRow

From row number

Int32 FromColumn

From column number

Int32 ToRow

To row number

Int32 ToColumn

From column number

Boolean FixedFromRow
Boolean FixedFromColumn
Boolean FixedToRow
Boolean FixedToColumn
Returns
Type Description
String

The cell address in the format A1

GetAddressCol(Int32, Boolean)

Get the columnn address for the column

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

The column

Boolean Absolute

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

Returns
Type Description
String

GetAddressRow(Int32, Boolean)

Get the row number in text

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

The row

Boolean Absolute

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

Returns
Type Description
String

GetColumnLetter(Int32)

Returns the character representation of the numbered column

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

The number of the column

Returns
Type Description
String

The letter representing the column

GetColumnLetter(Int32, Boolean)

Returns the character representation of the numbered column

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

The number of the column

Boolean 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
Boolean

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
Boolean

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
Boolean

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
Boolean

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
Boolean

TranslateFromR1C1(String, Int32, Int32)

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

Int32 row

Current row

Int32 col

Current column

Returns
Type Description
String

The RC address

TranslateToR1C1(String, Int32, Int32)

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

Int32 row

Current row

Int32 col

Current column

Returns
Type Description
String

The absolut address/Formula

In this article
Back to top Generated by DocFX