Reset values daily

Google searching is your friend. I did a search on: google script clear a range of data

Here is a link that I found: https://www.youtube.com/watch?v=LiKF6Vq3P-s

Then one on: google script running a function periodically
This came up at the top of the list: https://stackoverflow.com/questions/3018875/is-it-possible-to-automate-google-spreadsheets-scripts-e-g-without-an-event-to

There are many other hits if neither of these fits what you want to do but as you read through the ones that don’t work you’ll learn so it’s not a loss.

2 Likes

Thank you!

I found this guide by Google which really helped me: https://developers.google.com/apps-script/guides/triggers/installable

Plus (too late) I found your simpler form of writing the clearing function:

function clearAFewColumns() {
  var sheet = SpreadsheetApp.getActive().getSheetByName('Sheet2');
  var lastRow = sheet.getLastRow();
  
  // Column E = 5; F = 6   
  sheet.getRange(2, 5, lastRow, 1).clearContent();
  sheet.getRange(2, 6, lastRow, 1).clearContent();
  
}

And everything works now, thanks again!

1 Like