Class ExcelCellBase
Base class containing cell address manipulating methods.
Inherited Members
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 |
---|---|---|
System. |
Row | The number of the row |
System. |
AbsoluteRow | Absolute row |
System. |
Column | The number of the column in the worksheet |
System. |
AbsoluteCol | Absolute column |
Returns
Type | Description |
---|---|
System. |
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 |
---|---|---|
System. |
Row | The number of the row |
System. |
Column | The number of the column in the worksheet |
Returns
Type | Description |
---|---|
System. |
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 |
---|---|---|
System. |
Row | The number of the row |
System. |
Column | The number of the column in the worksheet |
System. |
Absolute | Get an absolute address ($A$1) |
Returns
Type | Description |
---|---|
System. |
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 |
---|---|---|
System. |
FromRow | From row number |
System. |
FromColumn | From column number |
System. |
ToRow | To row number |
System. |
ToColumn | From column number |
Returns
Type | Description |
---|---|
System. |
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 |
---|---|---|
System. |
FromRow | From row number |
System. |
FromColumn | From column number |
System. |
ToRow | To row number |
System. |
ToColumn | From column number |
System. |
Absolute | if true address is absolute (like $A$1) |
Returns
Type | Description |
---|---|
System. |
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 |
---|---|---|
System. |
FromRow | From row number |
System. |
FromColumn | From column number |
System. |
ToRow | To row number |
System. |
ToColumn | From column number |
System. |
FixedFromRow | |
System. |
FixedFromColumn | |
System. |
FixedToRow | |
System. |
FixedToColumn |
Returns
Type | Description |
---|---|
System. |
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 |
---|---|---|
System. |
Col | The column |
System. |
Absolute | If the column is absolute. Adds a $ before the address if true |
Returns
Type | Description |
---|---|
System. |
GetAddressRow(Int32, Boolean)
Get the row number in text
Declaration
public static string GetAddressRow(int Row, bool Absolute = false)
Parameters
Type | Name | Description |
---|---|---|
System. |
Row | The row |
System. |
Absolute | If the row is absolute. Adds a $ before the address if true |
Returns
Type | Description |
---|---|
System. |
GetColumnLetter(Int32)
Returns the character representation of the numbered column
Declaration
protected static string GetColumnLetter(int iColumnNumber)
Parameters
Type | Name | Description |
---|---|---|
System. |
iColumnNumber | The number of the column |
Returns
Type | Description |
---|---|
System. |
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 |
---|---|---|
System. |
iColumnNumber | The number of the column |
System. |
fixedCol | True for fixed column |
Returns
Type | Description |
---|---|
System. |
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 |
---|---|---|
System. |
worksheetName | The name of the worksheet |
System. |
address | The address |
Returns
Type | Description |
---|---|
System. |
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 |
---|---|---|
System. |
workbook | The workbook, if other than current |
System. |
worksheetName | The name of the worksheet |
System. |
address | The address |
Returns
Type | Description |
---|---|
System. |
The full address |
IsValidAddress(String)
Returns true if the cell address is valid
Declaration
public static bool IsValidAddress(string address)
Parameters
Type | Name | Description |
---|---|---|
System. |
address | The address to check |
Returns
Type | Description |
---|---|
System. |
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 |
---|---|---|
System. |
cellAddress | The alphanumeric cell address |
Returns
Type | Description |
---|---|
System. |
True if the cell address is valid |
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 |
---|---|---|
System. |
value | Address |
System. |
row | Current row |
System. |
col | Current column |
Returns
Type | Description |
---|---|
System. |
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 |
---|---|---|
System. |
value | R1C1 Address |
System. |
row | Current row |
System. |
col | Current column |
Returns
Type | Description |
---|---|
System. |
The absolut address/Formula |