Quantcast
Channel: Hot Weekly Questions - Web Applications Stack Exchange
Viewing all articles
Browse latest Browse all 9701

Is there any way to set different values for multiple ranges all at once?

$
0
0

Is there any way via script to put "Apple" in cell A1 and "Banana" in cell B4 simultaneously?

The motivation to do so would be that the sheet would only recalculate one time. Currently it re-calculates twice, when I put each of the two values into their ranges via setValue.

I know I can do it if the range is contiguous, with setValues(["Apple","Banana"]), but unfortunately these destinations can't be made contiguous.

I also know that if I make a RangeList out of A1 and B4, I can do SetValue("Apple") on my RangeList and have "Apple" immediately go into both cells, but unfortunately, I need Apple and Banana, different values.

If I try SetValue(["Apple","Banana"]) on my RangeList, it just uses Apple and ignores Banana.

I also looked for spreadsheet.SuspendCalculation(), but unfortunately, that does not exist.


Viewing all articles
Browse latest Browse all 9701

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>