79357617

Date: 2025-01-15 09:16:59
Score: 0.5
Natty:
Report link

Never mind, I reconstruct my code to be as follow:

var rowAddr = spreadsheet.getRange('F21');

for (var i = 1; i <= numOfCopy-1; i++){

          

          var DestCell = 22 + (i * 4);
          rowAddr.setValue(DestCell);
          DestCell=spreadsheet.getRange('F22').getValue()
          //SpreadsheetApp.getUi().alert(DestCell);
          spreadsheet.getRange(DestCell).activate();
          spreadsheet.getRange('C22:E25').copyTo(spreadsheet.getActiveRange(), SpreadsheetApp.CopyPasteType.PASTE_NORMAL, false);
        
        }

So I use Cells in Google sheet to process the concatenation, put the next row address value to google sheet. And it works.

Reasons:
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Self-answer (0.5):
  • Low reputation (1):
Posted by: anna liem