Insert row between different data

前端 未结 1 532
不思量自难忘°
不思量自难忘° 2021-01-24 10:00

I\'m Andrew from Italy!

I\'m trying to write a script that inserts a blank row between some data in a spreadsheet.

Example, I have this data set:

<
1条回答
  •  别那么骄傲
    2021-01-24 10:46

    (: I agree with Sandy Good... Just of the top of my head, here's a piece of code that can get you started:

    function doSomething() {
     var spreadsheet = SpreadsheetApp.openById('yourID'), // Get the spreadsheet
         tab = spreadsheet.getSheets()[0], // Get the first tab
         values = tab.getRange(2, 1, tab.getLastRow(), 3).getDisplayValues(), //Get the values beginning in the second row because of the headers
         newValues = [], // Empty array where we're gonna push the new values
         lastDate,
         lastName;
    
     // Loop through all the values
     for(var i = 0; i 

    0 讨论(0)
提交回复
热议问题