dtjohnson / xlsx-populate

Excel XLSX parser/generator written in JavaScript with Node.js and browser support, jQuery/d3-style method chaining, encryption, and a focus on keeping existing workbook features and styles in tact.
MIT License
956 stars 183 forks source link

Add the vertically and horizontally next cell for a given cell when cells are merged. #297

Open abdulnine7 opened 3 years ago

abdulnine7 commented 3 years ago
function getNextVertically(sheet,cell){
        let col = cell.split(/^([A-Z]+|\d+)/)[1];
        let row = parseInt(cell.split(/^([A-Z]+|\d+)/)[2]);
        let i = 0;

        do {
            i++;
        } while(sheet.cell(col + (row+i)).value() === undefined ? true : false);

        return col + (row+i);
    }
Akxe commented 3 years ago

Why cell.relativeTo(colOffset, rowOffset) does not solve this?