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())
}
}
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter