jason jason -4 years ago 142
Python Question

Convert spreadsheet number to column letter

Answer Source
def colnum_string(n):
    div=n
    string=""
    temp=0
    while div>0:
        module=(div-1)%26
        string=chr(65+module)+string
        div=int((div-module)/26)
    return string
print colnum_string(28)
#output:AB
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download