简体   繁体   English

我可以从 Master Google Sheet 运行多个 Google 表格的 function 吗?

[英]Can I run function of multiple Google sheets from Master Google Sheet?

I have created 10 Google sheets ( copies of parent sheet) which has the same code seperately.我创建了 10 个 Google 表格(父表格的副本),它们分别具有相同的代码。 I want to run some function in all 10 Google sheets from the Parent Google sheet.我想在 Parent Google 工作表的所有 10 个 Google 工作表中运行一些 function。 For Example I want to run the following function in all 10 sheets without opening them from the parent Google sheet.例如,我想在所有 10 张工作表中运行以下 function 而不从父 Google 工作表中打开它们。 Ex to delete all Entries in 10 sheets Ex 删除 10 张表中的所有条目

function deleteentries () function 删除条目 ()

Is it possible by using Google sheet url?是否可以使用 Google 表格 url? Or provide me any other solution.或者为我提供任何其他解决方案。

I am new to appScript so explain your answer step by step.我是 appScript 的新手,因此请逐步解释您的答案。

Thank you for you help.谢谢你的帮助。

Collect all sheet IDs in your master project, put them into array and trigger the function for each of them within for loop, where you loop the array with sheet IDs.收集主项目中的所有工作表 ID,将它们放入数组并在for循环中为每个工作表触发 function,您可以在其中使用工作表 ID 循环数组。

 var sheets = ['sheet1 id as string', 'sheet2 id as string'];
    
    function loopAndDoSomething(){
      for (var d=0; sheets.length; d++){
         deleteentries(sheets[d]);
      }
    }

you send sheet id as function parameter and in deleteentries() you can open that sheet by ID and do something with it.您将工作表 ID 作为 function 参数发送,在 deleteentries() 中,您可以按 ID 打开该工作表并对其进行处理。 That would be one possible approach.那将是一种可能的方法。

暂无
暂无

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

相关问题 从母版向多个 Google 表格推送更新 - Push Updates To Multiple Google Sheets From Master Sheet 填充主表谷歌表 - Populating a master sheet google sheets 从 Google 表格的多个选项卡中提取一行数据并显示在一个主表格中 - Pull a row of data from multiple tabs in Google Sheets and display in one Master Sheet Google表格:将文件夹范围导入母版表格 - Google Sheets: Import folder range into Master Sheet Google 表格 - 将多张表格中的行复制到一个汇总表格中 - Google Sheet - Copy Rows from Multiple Sheets into a Single Summary Sheet 从源工作表向目标工作表中添加多行 - Appending multiple rows from a source sheet to a destination sheet in Google Sheets 将数据从其他多个工作表写入主Google Spreadsheet; 是覆盖每个供稿器表的结果,而不是覆盖所有结果 - Writing data to master Google Spreadsheet from multiple other sheets; am overwriting results of each feeder sheet instead of getting all results 如何让我的脚本在 Google 表格的多个表格上运行? 我正在插入带有数据的行并需要它在多张纸上运行 - How can I make my script run on multiple sheets on Google Sheets ? I'm inserting rows with data and need it to run on multiple sheets 从母版工作表的最后一行复制数据,并将其粘贴到Google工作表中另一工作表的特定单元格 - Copy data from last row of master sheet and paste it in specific cells in another sheet in google sheets 基于模板创建新的 Google Sheet 并将数据从 Master Sheet 导出到新创建的表 - Creating a new Google Sheet based off a template and exporting data from Master Sheet to newly created sheets
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM