Here is the code I'm attempting:
var day=new Date().getDay()-1; var month=new Date().getMonth(); var sheet=ss.getSheetByName((/^.\s/+month+'/'+day));
I'm new to regex, but essentially I'm writing a script for work that selects sheet by name, to be copied to another sheet based on certain criteria.
The spreadsheet contains a multitude of sheets, with old sheets being deleted and new ones added on a regular basis. Each sheet ends with a suffix in the format
mm-dd. How can I select a sheet based only off of the suffix, which is consistent?
The above, when parsed with the rest of my code, returns:
TypeError: cannot call method "getDataRange" of null.