According to this topic: How to convert a column number (e.g. 127) into an excel column (e.g. AA)
I don't understand what is in algorithm: here
Could someone explain me, what is happening in a while loop?
According to this topic: How to convert a column number (e.g. 127) into an excel column (e.g. AA)
I don't understand what is in algorithm: here
Could someone explain me, what is happening in a while loop?
It is, in effect, "converting" the column number to base 26, where the "digits" are the letters A..Z.
For example, for column 720:
modulo
= (720-1)%26 = 17columnName
= 'R'dividend
= (720-17)/26 = 27modulo
= (27-1)%26 = 0columnName
= A
+columnName
= AR
dividend
= (27-0)/26 = 1modulo
= (1-1)%26 = 0columnName
= A
+ columnName
= AAR
dividend
= (1-0)/26 = 0Resulting in AAR
.