Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

239
Views
When I copy data using Goolge Scripts it skips rows Is there a work around?

I have tried looping to just remove the cells I wanted but that didn't work, I have also tried adjusting how it looks at the cells in a range but and just messed around with everything i could find and think of but to no avail this is the closest thing I can get to. My goal is to copy data from one sheet to another based off of a specific value and it all look like I entered them in row by row with no skipping.


    function tranferData(){
      var today = new Date(getCurrentMonth());
      var ss=SpreadsheetApp.getActive();
      var sht=ss.getSheetByName('Sheet1');
      var sht2=ss.getSheetByName('Sheet2');
      var lastRow=sht.getLastRow();
      var lastColumn=sht.getLastColumn();
      var rng=sht.getRange(1,1,lastRow,lastColumn);
      var rngA=rng.getValues();
      for(var i=0;i<rngA.length;i++)
      {
        var test = rngA[i][2];
        if(test < today  && test != null && test != 0)
        {
          sht2.getRange(i+1,1).setValue(rngA[i][0]);
          sht2.getRange(i+1,2).setValue(rngA[i][1]);
          sht2.getRange(i+1,3).setValue(rngA[i][2]);
          sht2.getRange(i+1,4).setValue(rngA[i][3]);
        }
      }
      SpreadsheetApp.flush();
    }

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!