This is a very small Apps Script snippet to generate column addresses from column numbers that can be useful in things like Sheet Addons.

For example 1 gives A, 27 – AA, 703 – AAA and so on.

Just pass the column number (starting at 1) and get the label back.

/**
 * create a column label for sheet address, starting at 1 = A, 27 = AA etc..
 * @param {number} columnNumber the column number
 * @return {string} the address label 
 */
function columnLabelMaker (columnNumber,s) {
  s = String.fromCharCode(((columnNumber-1) % 26) + 'A'.charCodeAt(0)) + ( s || '' );
  return columnNumber > 26 ? columnLabelMaker ( Math.floor( (columnNumber-1) /26 ) , s ) : s;
}

Many of the snippets in this section of the site are part of the cUseful library. You can find the details below.

For more like this see Google Apps Scripts Snippets
Why not join our forum,follow the blog or follow me on Twitter to ensure you get updates when they are available.