How do I know if spreadsheet cells are merged using google apps script

Yes, now you can use isPartOfMerge to check.

And for anyone wants to get the value of merged cell:

var value = (cell.isPartOfMerge() ? cell.getMergedRanges()[0].getCell(1,1) : cell).getValue();

Hope it help.

Leave a Comment