title: create button to navigate to a given sheet name
body: <p>I am trying to create a button to more easily navigate a google sheet with many tabs. The aim is to have many buttons on one sheet (one button per tab).</p>
  
  <p>My following script works but i want to make it dynamic instead of hard coding a sheet name ('Sheet1' for example).</p>
  
  <pre><code>function gotoSheet() {
    var ss = SpreadsheetApp.getActive();
    var sheet = ss.getSheetByName('Sheet1');
  
    sheet.activate();
  }
  </code></pre>
  
  <p>This is what i currently have:</p>
  
  <pre><code>function gotoSheet(cellReference) {
    var ss = SpreadsheetApp.getActive();
    var sheet = ss.getSheetByName(ss.getRange(cellReference));
  
    sheet.activate();
  }
  </code></pre>
  
  <p>The parameter <em>cellReference</em> ideally refer to a cell that contains the sheet name (eg: cell "A1" has the value "Sheet1")</p>
  
  <p>Where am I going wrong?</p>