As noted in the code below I can do my loop and read data from the cells but I don’t know how to modify a single cell.
function modifyDataInRange(){
var range1 = SpreadsheetApp.getActiveSpreadsheet().getSheetByName('MyData').getRange("A2:J300");
var checkData = range1.getValues();
var j = 0;
while(checkData[j][0]!=""){
if(checkData[j][1] == "Old Data"){
checkData[j][1] = "New Data"; //this does not write to the cell
range1.setValue("New Data"); //this writes to every cell in the range
}
j += 1;
}
}
Is there a way to do something like range1.setvalue([j][1], “New Data”)?