I have to sort cell names like this :
A1
A2
A3
A10
What I tried with this wrong order :
A1
A10
A2
A3
Code :
var cells = [ 'A1' 'A10', 'A2', 'A3' ];
function mysort(a,b) {
return a.substr(0,1) - b.substr(0,1) && a.substr(1) - b.substr(1);
}
cells = cells.sort(mysort);
or
cells = cells.sort();
Any clue ?