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
intThe number of the row
AbsoluteRow
boolAbsolute row
Column
intThe number of the column in the worksheet
AbsoluteCol
boolAbsolute 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
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
intThe number of the row
Column
intThe number of the column in the worksheet
Absolute
boolGet 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
intFrom row number
FromColumn
intFrom column number
ToRow
intTo row number
ToColumn
intFrom 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
intFrom row number
FromColumn
intFrom column number
ToRow
intTo row number
ToColumn
intFrom column number
Absolute
boolif 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
intFrom row number
FromColumn
intFrom column number
ToRow
intTo row number
ToColumn
intFrom column number
FixedFromRow
boolFixedFromColumn
boolFixedToRow
boolFixedToColumn
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
Returns
GetAddressRow(int, bool)
Get the row number in text
public static string GetAddressRow(int Row, bool Absolute = false)
Parameters
Returns
GetColumnLetter(int)
Returns the character representation of the numbered column
protected static string GetColumnLetter(int iColumnNumber)
Parameters
iColumnNumber
intThe 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
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
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
stringThe workbook, if other than current
worksheetName
stringThe name of the worksheet
address
stringThe 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
stringthe 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
stringThe 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
stringThe 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
stringThe 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
TranslateFromR1C1(string, int, int)
Translates a R1C1 to an absolut address/Formula
public static string TranslateFromR1C1(string value, int row, int col)
Parameters
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
Returns
- string
The absolut address/Formula