Preview:
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())
  }

}
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