簡體   English   中英

有沒有辦法在多個Google表格文件中編輯同一單元格?

[英]Is there a way to edit the same cell across multiple Google Sheet Files?

我大約有40種不同的Google工作表文件,每隔幾個月我需要更改一個小區域的顏色/日期。

據我發現,有一種方法可以在多頁的工作表中編輯同一單元格。 但是,我還沒有找到一種在多張紙上編輯同一單元格的方法。

var color = Browser.inputBox("Enter the color");
var sheet = spreadsheetApp.openByUrl("Same link as if i was editing it actively from my browser");
sheet.getRange("M18").setBackground(color);

任何想法,將不勝感激! 謝謝!

您可以創建電子表格ID的數組,然后遍歷該數組。

function updateColor() {
  var spreadsheetIDs = ["ssID_One","ssID_Two","ssID_Three","ssID_etc"];
  var i=0,color="",sheet,thisID="";

  for (i=0;i<spreadsheetIDs.length;i+=1) {
    thisID=spreadsheetIDs[i];
    color = Browser.inputBox("Enter the color");
    sheet = SpreadsheetApp.openById(thisID).getSheetByName('sheetNameHere');
    sheet.getRange("M18").setBackground(color);
  };
};

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM