0
votes

I am trying to create a script for a google form, so that it will delete all cells from A2 to J50. I need any cells except for the top-most row to be deleted every sunday (I think I can just use the event trigger, so I should just need the code to wipe all but that top row).

Right now, I have: enter image description here

It is filled out with my correct sheet name, but I just get:

TypeError: Cannot call method "getRange" of null. (line 3, file "Code")

1
A time driven trigger may be more useful if you want it to run every Sunday - random-parts
Welcome to Stack Overflow! Your image of text isn't very helpful. It can't be read aloud or copied into an editor, and it doesn't index very well, meaning that other users with the same problem are less likely to find the answer here. Please edit your post to incorporate the relevant text directly (preferably using copy+paste to avoid transcription errors). - Toby Speight

1 Answers

0
votes

The value of 'sheet' is set to null, because there's an error in the name of the sheet you provided to getSheetByName.

Double-check whether you've copied the right sheet name. Your code is fine otherwise.