title: Rename a tab with todays date "MM/DD/YYYY" and then another one with "MM/DD/YYYY-1"
body: <p>i got a script that create a new tab and changes the name to today's date. But if a run the script again, shows up an error bc the tabs name already exist. Anyway I can rename the first with today date and the rest with a &quot;- 1&quot; or &quot;- 2&quot;. This is what I have at the moment that just create a new tab and changes the name to today's,</p>
  <pre><code>function changeDate() { //Add sheet and name with todays date
    var spreadsheet = SpreadsheetApp.getActive();
    spreadsheet.getRange('A1:AO102').activate();
    spreadsheet.insertSheet(1);
    var ss = SpreadsheetApp.getActiveSpreadsheet();
    var tz = ss.getSpreadsheetTimeZone();
    var sheets = ss.getSheets();
    var date = Utilities.formatDate(new Date(), tz, 'MM-dd-yyyy');
    sheets[1].setName(date);
  </code></pre>