簡體   English   中英

Google表格根據單元格編號值添加行具有值的單元格計數

[英]Google Sheets Add row based on cell number value the count of cell which has value

  • 考慮 colD 包含一些我需要根據 col D 值在下面插入行的值,它應該包括包含值的單元格。 Exp:如果單元格值 D 為 1,則不應添加任何行,但如果為 2,則應在下方添加一行,並且應使用 get.dataRange 對所有行進行循環以創建行。 提前感謝您的幫助**1]

如果要添加新行,請嘗試appendRow()方法。

例子:

const ss = SpreadsheetApp.getActiveSpreadsheet();
const sheet = ss.getSheets()[0];

// Appends a new row with 3 columns to the bottom of the
// spreadsheet containing the values in the array
sheet.appendRow(["a man", "a plan", "panama"]);

還有更多的測試方法,看看:

例子:

const ss = SpreadsheetApp.getActiveSpreadsheet();
const sheet = ss.getSheets()[0];
// Shifts all rows down by three
sheet.insertRows(1, 3);

暫無
暫無

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

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