我試圖從Google表格中獲取一些數據,以便插入兩個數組並使用for
循環,但我認爲我使用了錯誤的方法。TypeError:無法在Sheet對象中查找getCell函數
這是代碼:
function regValori() {
var datAgg = SpreadsheetApp.getActiveSpreadsheet().getSheetByName("datiaggiornati");
var f5 = SpreadsheetApp.getActiveSpreadsheet().getSheetByName("Foglio5");
var CValue = new Array();
var CName = new Array();
CValue.lenght = datAgg.getRange("B1").getValue();
CName.lenght = CValue.lenght;
for (var i = 0; i <= CValue.lenght; i++)
{
CValue[i] = datAgg.getCell(i, 16).getValue();
CName[i] = datAgg.getCell(i+2, 1).getValue();
}
var riga = f5.getRange("B2").getValue();
for (x = 3; x <= numCrypto; x++);
for (i=0;i<numCrypto;i++);
{
f5.getRange(riga, x).setValue(valCrypto[r+i]);
f5.getRange(2,numCrypto).setValue(nomiCrypto[r+i]);
}
}
錯誤:
TypeError: Impossible to find getCell function in the Sheet object
感謝您的幫助!
你的數據是怎樣的,你試圖得到哪個單元格? – aaron
函數必須從一張紙上讀取一組值並將其插入另一張(同一個Google文檔)。數組必須是動態的,因爲數據可以變化,但它們一起變化(即,如果第一組值是14而另一組值是14)。工作表是關於加密貨幣的。我希望有一張表格可以在預定的時間每天保存它們的價值(它會連續變化)。因此,函數必須讀取加密貨幣名稱(第一個數組)和加密貨幣值(第二個數組),並將其放入第二個表中,每天顯示更新後的值。 –
這回答你正在做什麼*試圖做*,但沒有回答我問的問題。 – aaron