How do you convert a numerical number to an Excel column name in C# without using automation getting the value directly from Excel.
Excel 2007 has a possible range o
private String getColumn(int c) { String s = ""; do { s = (char)('A' + (c % 26)) + s; c /= 26; } while (c-- > 0); return s; }
Its not exactly base 26, there is no 0 in the system. If there was, 'Z' would be followed by 'BA' not by 'AA'.