Answers for "c# convert excel column index to letter"

C#
0

c# convert excel column index to letter

private string GetExcelColumnName(int columnNumber)
{
    int dividend = columnNumber;
    string columnName = String.Empty;
    int modulo;

    while (dividend > 0)
    {
        modulo = (dividend - 1) % 26;
        columnName = Convert.ToChar(65 + modulo).ToString() + columnName;
        dividend = (int)((dividend - modulo) / 26);
    } 

    return columnName;
}
Posted by: Guest on January-14-2020

Code answers related to "c# convert excel column index to letter"

C# Answers by Framework

Browse Popular Code Answers by Language