Column name


I can't figure out how to get column names by its index. Like 1 => "A".
Found nothing in manual nor in the examples / sources.



The simplest way is to remember to use TCellAddress ( )for both converting 1=>A and A=>1. 

You have "EncodeColumn"
which will do what you want, but normally it is simpler to just create a TCellAddress record and use it to convert. For example:

//Convert from B5 to 5,2
a := TCellAddress.Create('B5');
xls.GetCellValue(a.Row, a.Col);


//Convert from 5,2 to B5:
 a := TCellAddress.Create(5, 2);
  DoSomething(a.CellRef);  //CellRef has the text "B5"

Those examples were taken from:


Thank you. "EncodeColumn" is the winner as I need column names and not cell references.
It's not too intuitive but now as I have it, it doesn't matter anymore.

Thx for the prompt reply!