0
votes

I'm stuck! Am I missing a function or object or is there a reasonable workaround?

I'd like to copy a range from one sheet to another sheet within the same Google Spreadsheet, copying the merged state of the cells but not copying the Conditional Formatting rules.

As far as I can tell: the only way to copy the merged state is to include formatting in the paste (i.e. a full paste), which also pastes the conditional formatting rules. There is no programmatic way to interact with the conditional formatting rules at all, nor is there a way to get merged state without complex workarounds.

Is there a way to do it?

If not, I could replace the conditional formatting with an onEdit(e) to evaluate each cell after edit if the edit occurred within a specified range (but that's proving a pain) then do the full paste.

1

1 Answers

0
votes

If I'm not misunderstanding your question, can you apply

.clearFormat()

to your pasted range, followed by

.merge()

https://developers.google.com/apps-script/reference/spreadsheet/range#merge