Reputation: 1
No idea how to script this myself and googling hasn't helped.
What I want to do:
Delete columns E:H every day at midnight. That's it.
Any help appreciated. Thanks
Upvotes: 0
Views: 370
Reputation: 64040
The first function creates a timebased trigger.
function createTimeBasedTrigger() {
var ss=SpreadsheetApp.openById("SpreadsheetID");
ScriptApp.newTrigger('deleteEtoH').timeBased().everyDays(1).atHour(0).create();
}
This function deletes columns 5 through 8
function deleteEtoH() {
var ss=SpreadsheetApp.openById("SpreadsheetID");
var sh=ss.getSheetByName("Sheet Name");
sh.deleteColumns(5,4)
}
Upvotes: 1