[英]Automatic copy table to a new Sheet without formula (Google Sheets script)
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).
我需要自动应用该过程(无需手动复制粘贴)。
You can try using copyTo()
. 您可以尝试使用
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
formatOnly :指定仅应复制格式
- contentsOnly : designates that only the content should be copied
contentsOnly :指定仅应复制内容
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.