Hi I want to do a script in the GoogleSpreadSheet like this:
var celula = 'B2'
var celula2 = 'B3'
var linha = 'S2';
var linha2 = 'S3';
if (celula != null); {
SpreadsheetApp.getActiveSheet().getRange(linha).setValue("ITDS001");
}
if (celula2 != null); {
SpreadsheetApp.getActiveSheet().getRange(linha2).setValue("ITDS002");
}
But instead of making it one by one I would like to know how to do a for with a i++ to get all cells from column B and all cells of column S and **if cells of column"B" +i are not null, set "ITDS"(String code) +i (1,2,3,etc) to cells on column "S"i **.
It would be like: if B2 is not null set ITDS001 to S2, if B3 is not null set ITDS002 to S3 and so on.