C# Excel数字转字母列标

var dividend = index;
var columnName = string.Empty;

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

return columnName;



from:http://stackoverflow.com/questions/181596/how-to-convert-a-column-number-eg-127-into-an-excel-column-eg-aa

你可能感兴趣的:(转换,Excel,C#,列标)