google apps script - Difference between array in row and columns -
i'm trying move content of column b3:b11 (range) column determined number of day in month @ cell c3 (day). each day in month (reeksorg) cell d2 contains: 1, e2: 2, f2: 3; up-to 31.
function move() { var sss = spreadsheetapp.getactivespreadsheet(); // present workbook var ss = sss.getsheetbyname('sheet1'); //get active sheet var range = ss.getrange('b3:b11').getvalues(); //assign range want // copy var day = ss.getrange('c3').getvalues(); // day date(c1) logger.log(day); // correct in log logger.log(range); // idem logger.log(range.length); // idem var reeksorg = ss.getrange('d2:h2').getvalues(); // "reeksorg" day- // numbers within month logger.log(reeksorg); // returns "range", should [[1.0],[2.0]] // etc. logger.log(reeksorg.length); // returns [1.0], should [5.0] }
although statements create both ranges similar outcome differs.
see log-output:
[17-08-18 16:04:21:095 cest] [[3.0]]
[17-08-18 16:04:21:095 cest] [[5.0], [6.0], [7.0], [8.0], [9.0], [10.0], [11.0], [12.0], [13.0]]
[17-08-18 16:04:21:096 cest] 9.0
[17-08-18 16:04:21:198 cest] [[1.0, 2.0, 3.0, 4.0, 5.0]]
[17-08-18 16:04:21:198 cest] 1.0
my goal copy "range" appropriate row/column (d3:h11) using loop. please help, i've limited programming knowledge.
how this?
function move() { var sss=spreadsheetapp.getactivespreadsheet(); var ss=sss.getsheetbyname('sheet1'); var srcrange=ss.getrange('b3:b11'); var day=ss.getrange('c3').getvalue();// day date(c1) var desrange=ss.getrange(3,day,10,1); srcrange.copyto(desrange); }
Comments
Post a Comment