r/GoogleAppsScript • • May 20 '26

Resolved AppsScript Help Please - Column O killing functions

Hello all.

I'm hoping someone here can help me because I'm at my wit's end. Long story short, I created and maintain (keep running) a spreadsheet for work that we use to track our service/breakdown department's performance and SLA compliance. Rather than scroll all the way to the bottom of the sheet and manually drag formulae into the new row, I've created a script that inserts a new row and enters the formulae into the top of the sheet. I have the code entering the formulae, instead of copying it, because it works faster than having a script that copy-pastes only the formula into the new row. And my script works a treat, EXCEPT for whatever is happening in column O.

When I remove the code for O, it works just fine. But with the code for column O included it has a shart attack and won't proceed. I've tried moving the data in O to L and the same thing happens. The script works fine until it has to process THAT particular column, then it just stops. Again, removing O from the code makes it work 100%. The code for O and H is almost identical and for all intents and purposes it is, the maths in the formula is a little different is all. I have tried many different versions and functions but the result is the same. It stops at O. I have even tested O with using the SAME EXACT CODE from another work column and it still will not work.

Oddly enough though, a script that simply copy-pastes row 6 into the newly inserted row 5 WILL copy column O, but also all the manually entered data as well which I don't want.

I think I've explained myself well enough. Please ask any questions you may have. My script is below.

1 Upvotes

6 comments sorted by

View all comments

Show parent comment

3

u/krakow81 May 20 '26

How did you sort it in the end? Always worth following up with the solution, in case anyone else stumbles across the thread with related or similar issues in the future.