Skip to content

Instantly share code, notes, and snippets.

@dhananjay431
Last active November 2, 2021 05:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dhananjay431/2ee3e2e61b36d16dc0bca1687f317953 to your computer and use it in GitHub Desktop.
Save dhananjay431/2ee3e2e61b36d16dc0bca1687f317953 to your computer and use it in GitHub Desktop.
xlsxColumn
function getColsName(num) {
var str = [];
for (var i = 0; i < parseInt(num / 26) + 1; i++) {
for (var j = 0; j < 26; j++) {
var zz = (i > 0 ? String.fromCharCode(65 + i - 1) : "") + String.fromCharCode(65 + j)
str.push(zz);
}
}
return str;
}
console.log(getColsName(300))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment