Created
April 28, 2022 08:45
-
-
Save meetpahul/80bdb3d597a484031b17741c3ae4c1a3 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Deletes sheets whose names contain the criteria string. Takes Spreadsheet URL and Criteria-string as arguments. | |
| function cleanSheets(url, criteriaString){ | |
| var ss = SpreadsheetApp.openByUrl(url) | |
| var sheets = ss.getSheets() | |
| for (var i=0; i<sheets.length; i++){ | |
| var sheetName = sheets[i].getSheetName(); | |
| if (sheetName.indexOf(criteriaString)>-1) {ss.deleteSheet(sheets[i])} | |
| } | |
| }; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment