'insertRowBefore' on Balance History; Will it break anything?


[Using Foundation Template if that matters.]

I am looking to do some things in Apps Script, and wanted to see if adding a new row at the top (after the headers) of the Balance History sheet using the `insertRowBefore()’ function would break anything.

Any advice?


I have one bank (PNC) that hasn’t been updating for over a month so I manually add rows to Balance History weekly to keep everything in line.

No issues at all.

Update with testing: If I add a row right after the header

  • sheet.insertRowsBefore(2,1);

It breaks Accounts and Balances sheets.
If I instead insert the row between row 2 and 3, it seems to work OK.

  • sheet.insertRowsBefore(3,1);

I have it figured out, and am going to post here in case it is useful for someone else. There is probably a more elegant way to do this, but this works.

//add a row in the 'middle' of the balance history sheet
//copy the existing first row down a row
balanceHistorySheet.getRange("A2:M2").copyTo(balanceHistorySheet.getRange("A3:M3"), {contentsOnly:true});
//clear the now-duplicate first row

//copy the new balance history entry that I want at the top