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
Just throwing in a simple two-line C# implementation using recursion, because all the answers here seem far more complicated than necessary.
///
/// Gets the column letter(s) corresponding to the given column number.
///
/// The one-based column index. Must be greater than zero.
/// The desired column letter, or an empty string if the column number was invalid.
public static string GetColumnLetter(int column) {
if (column < 1) return String.Empty;
return GetColumnLetter((column - 1) / 26) + (char)('A' + (column - 1) % 26);
}