TCellAddress Class
Small class that can convert between a string reference ("A1") into row and col integers (1,1).
Syntax
Namespace: FlexCel.Core
public class TCellAddress
Constructors
| Name | Description |
|---|---|
| TCellAddress | Overloaded TCellAddress TCellAddress(String) TCellAddress(Int32, Int32) TCellAddress(Int32, Int32, Boolean, Boolean) TCellAddress(String, Int32, Int32, Boolean, Boolean) |
Methods
| Name | Description |
|---|---|
| Clone | Returns a deep copy of the cell address. |
| QuoteSheet | Quotes a sheet name if it is needed. For example, Sheet 1 should be quoted as 'Sheet 1' |
| NameIsReserved | Returns true if the string can be a cell reference, like A1 or LVM78, or "R", "C", "TRUE" or "FALSE". If this method returns true, you can't name a sheet or a named range with name. |
| EncodeColumn | Returns "A" for column 1, "B" for 2 and so on. |
| DecodeColumn | Returns 1 for column "A", 2 for "B" and so on. If the string isn't a valid column name, this method will return -1. You normally will just want to create TCellAddress to convert between cell references (var cell = new TCellAddress(row, col); DoSomething(cell.CellRef). But this method could be used in specific cases where you want only the column string and not the full address. |
| ToString | Returns the cell reference. |
| CellRefR1C1 | Returns the cell reference in the objects in R1C1 notation. |
| TrySetCellRef | Overloaded TrySetCellRef(String) TrySetCellRef(String, TReferenceStyle, Int32, Int32) |
| TryParseSheet | Parses a string like Sheet1!A1 into a sheet component and the rest. If the sheet is quoted ('sheet 1') it will be unquoted. |
| Equals | Returns true if both objects have the same data. |
| GetHashCode | Returns the hashcode of this object. |
Properties
| Name | Description |
|---|---|
| Sheet | Sheet name of the reference. |
| Row | Row index for this reference (1-based). |
| Col | Column index for this reference (1-based). |
| RowAbsolute | True if the row is an absolute reference (as in A$5) |
| ColAbsolute | True if the column is an absolute reference (as in $A5) |
| CellRef | Cell address in Excel A1 notation. (For example "A5"). Absolute references ($A$5) will work too. |