function createCellPos( n ){
var ordA = 'A'.charCodeAt(0);
var ordZ = 'Z'.charCodeAt(0);
var len = ordZ - ordA + 1;
var s = "";
while( n >= 0 ) {

s = String.fromCharCode(n % len + ordA) + s;

n = Math.floor(n / len) - 1;

}
return s;
}

createCellPos(26)//"AA"

原文:https://blog.csdn.net/weixin_42349358/article/details/80517198

05-11 17:29