Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version
  1. Open your Google Sheets document.
  2. Click on the "Tools" menu and select "Script editor".
  3. In the Script editor window, click on "File" and select "New" > "Script file".
  4. Name the script file and paste the following code into the editor window:
function onOpen() {
  var ui = SpreadsheetApp.getUi();
  ui.createMenu('Go To')
      .addItem('Cell A1', 'goToA1')
      .addItem('Cell B1', 'goToB1')
      .addToUi();
}

function goToA1() {
  var sheet = SpreadsheetApp.getActiveSpreadsheet().getActiveSheet();
  var cell = sheet.getRange("A1");
  sheet.setActiveRange(cell);
}

function goToB1() {
  var sheet = SpreadsheetApp.getActiveSpreadsheet().getActiveSheet();
  var cell = sheet.getRange("B1");
  sheet.setActiveRange(cell);
}
  1. Save the script file and go back to your Google Sheets document.
  2. Refresh the document and you should see a new "Go To" menu in the menu bar.
  3. Click on the "Go To" menu and select the cell you want to navigate to.