I have the following script that duplicates a specified sheet, duplicates in and renames it to todays date.
function Duplicate() {
var source = SpreadsheetApp.getActiveSpreadsheet();
const patternX = 'Master';
var masterX = source.getSheetByName(patternX);
masterX.copyTo(source).setName(getDates()[1]).showSheet();
masterX.hideSheet();
}
I am struggling with making the following amendments to it:
- Is it possible to automatically add the date of duplication into Cell A1 of the duplicated new sheet?
- How does one make the duplicate sheet active/move it to first sheet in the Workbook?