Table of Contents

TCellAddress Record

Small class that can convert between a string reference ("A1") into row and col integers (1,1).

Syntax

Unit: FlexCel.Core

TCellAddress = record;

Methods

Name Description
CellRefR1C1 Returns the cell reference in the objects in R1C1 notation.
Create Overloaded
Create(string)
Create(Integer, Integer)
Create(Integer, Integer, Boolean, Boolean)
Create(string, Integer, Integer, Boolean, Boolean)
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.
Empty Returns a Cell Address pointing to an invalid reference.
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.
HasValue Returns true if the record has a defined value. This is the inverse of IsNull
IsNull Returns true if the record doesn't have a defined value.
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'
ReadSimpleCol An optimized method to read cell references in xlsx files. It won't allow sheets.
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, Integer, Integer)

Operators

Name Description
Equality Adapts the = operator so it returns true when both instances have the same values.
Inequality Adapts the <> operator so it returns true when both instances have different values.

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.