function unmergeAllCells() { let app = SpreadsheetApp; let activeSheet = app.getActiveSpreadsheet().getActiveSheet(); let lastrow = activeSheet.getLastRow(); let lastCol = activeSheet.getLastColumn(); for (column = 1; column < lastCol; column++){ let mergerange = activeSheet.getRange(1,column,lastrow).getMergedRanges(); mergerange.map(cells => cells.breakApart()) } }