I am working on a macro that is supposed to:
- Create a copy of the current open spreadsheet
- The copy must be in the same folder that the original is in
- Open the copy created in a new tab
Nice to have: While running the macro, show a pop-up allowing the user to add to the name of the file, substituting the "(Template)" with the number that the people add.
So far I have the 1 and 2 done, but part 3 and the nice to have I need help.
function NewSheet() {
var sheet = SpreadsheetApp.getActiveSpreadsheet();
var destFolder = DriveApp.getFolderById("xxxxx");
DriveApp.getFileById(sheet.getId()).makeCopy("yyyy (Template)", destFolder);
};
Any insights?