Hi, I decided to share object I made, where I solved this problem.
Problem: Getting an excel column value (like AL) from number representation (column 56) up to ZZ column
Input: Number (number)
Output: Column (text)
Code:
Problem: Getting an excel column value (like AL) from number representation (column 56) up to ZZ column
Input: Number (number)
Output: Column (text)
Code:
Code:
'ABCDEFGHIJKLMNOPQRSTUWVXYZ (26)
dim ab = "ABCDEFGHIJKLMNOPQRSTUWVXYZ"
if number < 27 then
'one alphabet set only
column = Mid(ab, number, 1)
else
'for each alphabet set
dim wholes = number/26
if wholes > 26 then
'more than ZZ ref
column = "ERROR Number too big!"
return
end if
wholes = int(wholes)
dim ten = Mid(ab, wholes, 1)
dim ones = number  26 * wholes
'fix for last Z
if ones = 0 then
ones = 26
end if
'remaining number
dim one = Mid(ab, ones, 1)
'concacinate
column = ten & one
end if
Attachments

12.9 KB Views: 17
Last edited: