简体   繁体   English

如何通过 GOOGLE APPS SCRIPT 自动将多个谷歌表格中的数据合并到另一个谷歌表格

[英]How to automatic combine data from multiple google sheets to another google sheet by GOOGLE APPS SCRIPT

Everyday I have to manually do a report with the data got from multiple google sheets (all have one sheet with the same number of columns) to another google sheet (just have 1 sheet as well).每天我都必须手动使用从多个谷歌工作表(都有一个具有相同列数的工作表)获取的数据到另一个谷歌工作表(也只有 1 个工作表)进行报告。 I loaded all of the google sheets and then copy and paste one by one to the report.我加载了所有的谷歌表格,然后一一复制并粘贴到报告中。 So I would like to ask you how to automatic do this progress by GOOGLE APPS SCRIPT.所以我想问你如何通过GOOGLE APPS SCRIPT自动完成这个进度。 If there are any way to get the data without loading the google sheets is great.如果有任何方法可以在不加载谷歌表格的情况下获取数据,那就太好了。 Ex: I have the link of stage profit such as VIC profit, NSW profit, QLD profit, etc. (I'm in Australia) and I need to report of national profit.例如:我有VIC利润,NSW利润,QLD利润等阶段利润的链接(我在澳大利亚),我需要报告国家利润。 Could you please advise me?你能告诉我吗?

Much appreciate your advice.非常感谢您的建议。

Phuc.福。

You can open another "file" with SpreadsheetApp.openById() .您可以使用SpreadsheetApp.openById()打开另一个“文件”。 And from there you can use its sheets, data, everything.从那里你可以使用它的工作表、数据和一切。

https://developers.google.com/apps-script/reference/spreadsheet/spreadsheet-app#openbyidid https://developers.google.com/apps-script/reference/spreadsheet/spreadsheet-app#openbyidid

var ss_current = SpreadsheetApp.getActiveSpreadsheet();
var ss_remote = SpreadsheetApp.openById("abc1234567");

var values = ss_remote
  .getSheetByName("Expenses")
  .getRange('A1:C')
  .getValues();

and you can insert it here你可以在这里插入

暂无
暂无

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

相关问题 使用 Google 表格上的 Google Apps 脚本将多个电子表格导入 1 张表格 - Import Multiple Spreadsheets into 1 Sheet using Google Apps Script on Google Sheets 使用Google Apps脚本从Google表格打印选择表格 - Printing select sheets from google sheet with Google Apps Script Google Apps Script - 如何将此代码应用于 Google 表格中的多个表格 - Google Apps Script - how to applies this code for multiple sheets in google sheets 如何将 Google Apps 脚本应用于多个工作表 - How to apply Google Apps Script to multiple sheets 如何使用 Google Apps 脚本将表格从 Google 表格上传到 AWS S3 作为 CSV? - How to upload a sheet from Google Sheets to AWS S3 as a CSV using google Apps Script? 如何使用 Google Apps Script 在来自 Google 表格的多行中拆分 Google 幻灯片表中的数据(基于字符限制)? - How to split data in a Google Slides Table (based on character limit) in multiple rows coming in from a Google Sheet using Google Apps Script? 在Apps脚本中使用相同工作表的Google表格API - Using Google Sheets API from within Apps Script for same Sheet 使用 Google Apps 脚本将数据保存在 Google 表格中 - Saving data in Google Sheets with Google Apps Script 使用 Apps 脚本从 Google 表格中的另一张表格中删除包含值的行 - Delete rows containing value from another sheet in Google Sheets using Apps Script 使用 Google 表格中的数据在 Google Apps 脚本中自动完成 - Autocomplete in Google Apps Script with data from Google Sheets
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM