I have a Google Sheet with a table that looks something like this:
date | value1 | value2 |
---|---|---|
day 2 | foo | foo |
day 1 | bar | bar |
Every day has a certain amount of records, and from time to time I add new records. The way I do it currently is:
- Shift existing rows down depending on how many rows I need to insert;
- Insert new records into the freed up cells.
I'd like to automate this with Google Scripts by making it be this way:
- Click on B1 and paste from clipboard;
- Have all the old rows automatically move down depending on how many rows are in what I'm pasting, and new rows be inserted into the freed up cells.
I wonder if there is a way to do this.
This is a good reference code, but I'm stuck on the "depending on" part.