Paste Special Values

前端 未结 2 1887
太阳男子
太阳男子 2020-12-14 13:54

I have a range consisting of 3 columns and 2 (or more) rows. The middle column contains a formula: =TRANSPOSE(SPLIT(A1,\",\"))

The script needs to move

2条回答
  •  被撕碎了的回忆
    2020-12-14 14:07

    Just as an alternative, you can use copyTo() with advanced arguments to copy values only. To mimic the effect of moveTo(), you would still need to clear the source range.

    Also, if it's easier, getRange() accepts a string reference that includes the sheet name. So:

    function moveValuesOnly() {
      var ss = SpreadsheetApp.getActiveSpreadsheet();
      var source = ss.getRange('Sheet1!F1:H3');
      source.copyTo(ss.getRange('Sheet2!A1'), {contentsOnly: true});
      source.clear();
    }
    

提交回复
热议问题