Home > Mobile >  how to flip upside down range to setvalues?
how to flip upside down range to setvalues?

Time:09-03

ive used it before, but cant remember and searching all i find is transpose, which isnt what im looking for

just to invert row order upside down

a  1     c  3
b  2  >  b  2
c  3     a  1

basic code im using:

  var Data = ss_s.getRange(1,1,lr,lc).getValues();
  ss_t.getRange(1,1,lr,lc).setValues(Data);

i remember i did something like

  ss_t.getRange(1,1,lr,lc).setValues.inverted(Data);

but i cant cant find correct funcion

CodePudding user response:

Instead of

 ss_t.getRange(1,1,lr,lc).setValues.inverted(Data);

use

ss_t.getRange(1,1,lr,lc).setValues(Data.reverse());

Range.getValues() returns an Array of Arrays (Array 2D).

Resources

References

  • Related