I'm trying to simply my life by creating a Google Apps Script that makes a copy of another template sheet in my drive and then paste the URL and the name of that new sheet in the original sheet I run the script from.
The script I've made below does just that. However, every time the script is ran, the new URL value is always pasted in "A12". How can I make the script paste that value to the next cell down?
function saveAsSpreadsheet£(){
var sheet = SpreadsheetApp.getActiveSpreadsheet();
var ss = sheet.getSheets()[0];
var range = ss.getRange("I6");
var values = ss.getRange("A12");
var data = range.getValue();
var destFolder = DriveApp.getFolderById("xxxxxxxxxxxxxxxxxxx");
var makecopyurl = DriveApp.getFileById(sheet.getId()).makeCopy(data + " Management Workbook", destFolder).getUrl();
var npo = '=hyperlink("' + (makecopyurl) + '";"' + data + '")';
values.setValue(npo)}
Here's a link to an example spreadsheet.