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:
'ABCDEFGHIJKLMNOPQRSTUVXYZ (25)
dim ab = "ABCDEFGHIJKLMNOPQRSTUVXYZ"
if number < 26 then
'one alphabet set only
column = Mid(ab, number, 1)
else
'for each alphabet set
dim wholes = number/25
if wholes > 25 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  25 * wholes
'fix for last Z
if ones = 0 then
ones = 25
end if
'remaining number
dim one = Mid(ab, ones, 1)
'concacinate
column = ten & one
end if
Attachments

12.9 KB Views: 4
Last edited: