Ask Your Question
1

How can I navigate to a specific cell in Google Sheets using a custom menu?

asked 2023-01-04 11:00:00 +0000

nofretete gravatar image

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
3

answered 2022-09-22 05:00:00 +0000

scrum gravatar image
  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.
edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account. This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss

Add Answer


Question Tools

Stats

Asked: 2023-01-04 11:00:00 +0000

Seen: 17 times

Last updated: Sep 22 '22