Here some code i done a while ago, when analyzing massive xls sheets.
think it handles 10+letters.
coltonum does bitshifting 16 8 2, and alsor and to uppercase. should be pretty quick
not 100% tested, but it did wat i wanted at the time
function ColumnToNumber(const colStr:ShortString):UInt64;
var
i:UInt32;
strBytes:array[0..255] of Byte absolute colStr;
begin
Result:=0;
for i:=1 to strBytes[0] do // shortstring so byte 0 is length
begin
//bit shifting 16 8 2 to get 26, and $DF to uppercase byte
Result:=(Result shl 4)+(Result shl 3)+(Result shl 1)+UInt64((strBytes[i] and $DF)-64);
end;
end;
function NumberToColumn(num:UInt64):ShortString;
var
temp: array[0..15] of Byte;
idx,i: UInt32;
remainder: UInt32;
begin
if num=0 then exit('');
idx:=0;
while num>0 do
begin
Dec(num);
remainder:=num mod 26;
num:=num div 26;
temp[idx]:=remainder+65;
Inc(idx);
end;
Byte(Result[0]):=idx;
for i:=0 to idx-1 do
begin
Byte(Result[i+1]):=temp[(idx-1)-i];
end;
end;