I am having a hard time with Ranges and figuring out why I need to add i+1 in getRange to get the correct cell in my loop. I'm not sure if its because I increment before the variable or if it has something to do with the initial value?
var ss = SpreadsheetApp.getActiveSpreadsheet();
var sheet = ss.getSheetByName("Sheet1");
var range = sheet.getDataRange();
var values = range.getValues();`
for (var i = 3; i < 30; ++i) {
var row = values[i];
var msgSent = row[3];
sheet.getRange(i + 1, 4).setValue("ALERTED");
Any help is appreciated!