Table of Contents

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

Methods

Name Description
CellRefR1C1 Returns the cell reference in the objects in R1C1 notation.
Clone Returns a deep copy of the cell address.
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.​Cell​Ref)​.​
But this method could be used in specific cases where you want only the column string and not the full address.
EncodeColumn Returns "A" for column 1, "B" for 2 and so on.
Equals Returns true if both objects have the same data.
GetHashCode Returns the hashcode of this object.
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.
QuoteSheet Quotes a sheet name if it is needed. For example, Sheet 1 should be quoted as 'Sheet 1'
ToString Returns the cell reference.
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.
TrySetCellRef Overloaded
TrySetCellRef(String)
TrySetCellRef(String, TReferenceStyle, Int32, Int32)

Properties

Name Description
CellRef Cell address in Excel A1 notation. (For example "A5").
Absolute references ($A$5) will work too.
Col Column index for this reference (1-based).
ColAbsolute True if the column is an absolute reference (as in $A5)
Row Row index for this reference (1-based).
RowAbsolute True if the row is an absolute reference (as in A$5)
Sheet Sheet name of the reference.