简体   繁体   English

自动将表格复制到不带公式的新表格中(Google表格脚本)

[英]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 :指定仅应复制内容
  • CTRL + C the table CTRL + C
  • CTRL + SHIFT + V to the second sheet CTRL + SHIFT + V到第二张纸

0

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Google Sheets/Apps Script Copy 公式到新行 - Google Sheets/Apps Script Copy Formula to new row 使用脚本将值和格式复制到Google工作表中的新工作表 - Copy Value and Format to new sheet in Google sheets using a script Google脚本帮助:将没有源链接的数据透视表复制到新工作表 - Google Script help: copy pivot table without source linkage to a new sheet Google Sheets 脚本帮助请求:将选中的行从多个工作表复制到新工作表 - Google Sheets Script Help Request: Copy check boxed rows from multiple sheets to new sheet 用于将范围复制到另一张工作表的 Google 表格脚本 - Google Sheets script to copy a range to another sheet 如何将一张工作表的值复制到另一张工作表Google工作表脚本 - How to copy the value of one sheet to another sheet Google sheets Script 谷歌表谷歌脚本中的特殊公式可以防止复制 - google sheet Special formula in google script protect from copy 使用谷歌工作表脚本时,如何将电子表格的工作表复制到另一个电子表格中而不创建新的工作表副本? - How to copy spreadsheet's sheet into another spreadsheet without creating a new sheet copy when using google sheet script? 用于在最后一条记录后复制并粘贴到另一个工作表的 Google Sheets 脚本 - Google Sheets script to copy and paste in another sheet after the last record 通过for循环谷歌表格脚本将行复制到另一张表格 - Copy row to another sheet via for loop google sheets script
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM