When I use a reference from the following function, it does not work (even though when I check the variable value it shows 6 and when I look at the variable type, it is an integer with no decimal places)
XL_String_To_Number("F")
XL_String_To_Number(Column){
StringUpper, Column, Column
Index := 0
Loop, Parse, Column ;loop for each character
{ascii := asc(A_LoopField)
if (ascii >= 65 && ascii <= 90)
index := index * 26 + ascii - 65 + 1 ;Base = 26 (26 letters)
else { return
} }
return, index
}
Code: Select all
xls.Range("A2:" . LastCol_Alpha . LastRow).Sort(xls.Columns(6),1) ;this works
xls.Range("A2:" . LastCol_Alpha . LastRow).Sort(xls.Columns(Sort_Col_NB),1) ;this does not
Anybody have any ideas on what I'm doing wrong?