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();
}