Paste Special Values
google-apps-script, google-sheets
Solution
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();
}
Problem
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 (cut) that range onto another sheet as values, not formulas. Does google-apps-script have a means of doing "PasteSpecial - Values"? Here is the line I'm currently using: ``` sheet1.getRange("F1:H3").moveTo(sheet2.getRange("A1")); ``` Can anyone tell me how I can lock those values in before they move onto sheet2 ? (FYI: this requires a code solution only)