convert index to column. Eg: IndexToColumn(2) = "B", IndexToColumn(28) = "AB"

def IndexToColumn (ndx):
        """convert index to column. Eg: IndexToColumn(2) = "B", IndexToColumn(28) = "AB" """
        ndx -= 1
        col  = chr(ndx % 26 + 65)
        while (ndx > 25):
                ndx  = ndx // 26
                col  = chr(ndx % 26 + 64) + col
        return col