I have some nested array of data, for example something like [[1, 2], [2, 3, 4]]
, and I'd like to be able to update the values of cells on a specific worksheet with this data efficiently.
The problem I'm having is that the data isn't square, and so I'm currently:
- looping over the data and getting each sub-array, and then checking this sub-array's length
- getting a range object for a row that corresponds to the index in the outer array, that is the length of the sub-array I'm processing currently.
- Setting the values of this single-row range object.
I'm wondering if there's some way to do all this value setting in a single step. How do I build a range object that a) will let me write outside it's bounds, or b) is very not rectangular? Or is there some other better way to approach this entirely?
Thanks so much for any help. I've been a bit stuck on figuring if this is the best solution for a few days. Thanks again!