简体   繁体   English

Javascript循环浏览每个Google表格标签,并将所有单元格复制并粘贴为仅值

[英]Javascript to cycle through each google sheet tab and copy and paste all cells as values only

I'm completely new to Javascript, so thanks in advance for the help with this as it'll significantly help get me into JS. 我对Java完全陌生,因此在此先感谢您的帮助,因为它将极大地帮助我进入JS。

What's needed: 需要什么:

  • Cycle through each tab in a googlesheet (gsheet) (some tabs may be hidden) 循环浏览googlesheet(gsheet)中的每个标签(某些标签可能被隐藏)
  • Copy/Paste all cells as values only 复制/粘贴所有单元格仅作为值

Basically, get rid of all the formulas. 基本上,摆脱所有公式。 I use a lot of importrange data that is constantly updated. 我使用了大量的importrange数据,这些数据会不断更新。 At the end of closing the books, we need all that import stuff to stop and the tabs to be static. 在关闭书本的最后,我们需要停止所有导入的工作,并需要使选项卡为静态。

Someone on a google forum sent the answer. Google论坛上的某人发送了答案。 Thanks all. 谢谢大家

function removeFormulas() {
    SpreadsheetApp.getActive().getSheets()
        .forEach(function (sh) {
            sh.getDataRange().setValues(sh.getDataRange().getDisplayValues())
        })
}

暂无
暂无

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

相关问题 如何使用 Google 脚本从 1 个 Google 工作表中复制特定值并粘贴到另一个工作表? - How can I copy specific values from 1 Google Sheet and paste to another Sheet using Google Script? CopyPasteType.PASTE_VALUES 不会仅复制 Google 表格中的值 - CopyPasteType.PASTE_VALUES does not copy only values in Google Sheets 仅将第一行粘贴到 Javascript 提示但复制所有行 - Paste only first line into Javascript Prompt but copy all lines 使用Google表格脚本移动过滤后的值(复制和粘贴值),而忽略列标题/标题 - Moving filtered values (copy and paste values) using google sheet script while ignoring the column heading / title 如何使用 Google Sheets Macros 从一张工作表复制值并将它们粘贴到另一张工作表中? - How to copy values from one sheet and paste them into another using Google Sheets Macros? 如何连续搜索昨天的日期,然后将值复制/粘贴到新的 Google 表格 - How to search for yesterday's date in a row, then copy / paste values to new Google Sheet Google Sheets / Javascript -> 循环遍历数组并将值设置为单元格 - Google Sheets / Javascript -> Loop through array and set the values to the cells 将表单上多个单元格的值复制提交到其他Google表格中的单个单元格中 - Copy values of multiple cells on form submit into a single cell in a different Google Sheet 使用javascript复制和粘贴按钮? - copy and paste through buttons using javascript? Google 工作表脚本将数据集从一张工作表复制到另一张工作表的顶部(仅限值) - Google sheets script copy data sets from one sheet to another (values only) at the top of the sheet
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM