Why doesn't copyTo(… PASTE_VALUES) work in the middle of a macro?
One of my longstanding techniques with spreadsheets is Copy / Paste Special Values (C/PSV), in place. Having used formulas to produce the values I'm interested in, I C/PSV and can then delete the source data. So I wrote a macro which uses this technique, but the cells wind up empty. But if I split the macro into two, ending the first macro before C/PSV, then everything works as intended. Why is this? Is there a better way to work around this problem? Here are my three macros. function Step1() { var spreadsheet = SpreadsheetApp.getActive(); var range = spreadsheet.getActiveRange();