Please try if this method can meet your needs:
private static string GetColumnName(int colNum)
{
string columnName = String.Empty;
int modulo;
while (colNum > 0)
{
modulo = (colNum - 1) % 26;
columnName = Convert.ToChar(65 + modulo).ToString() + columnName;
colNum = (int)((colNum - modulo) / 26);
}
return columnName;
}
If the response is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.