Reputation: 189
There is a Sheet, which consists of a table with formulas. How it possible to get only values (without formulas) to a second Sheet? I need the process to apply automatically (without Copy Paste by hands).
Upvotes: 0
Views: 1643
Reputation: 765
You can try using copyTo()
. By default both the values and formatting are copied, but this can be overridden using advanced arguments.
// The code below copies only the values of the first 5 columns over to the 6th column.
var sheet = SpreadsheetApp.getActiveSheet();
sheet.getRange("A:E").copyTo(sheet.getRange("F1"), {contentsOnly:true});
The advanced parameters are the following:
- formatOnly: designates that only the format should be copied
- contentsOnly: designates that only the content should be copied
Upvotes: 1