Skip to content

Instantly share code, notes, and snippets.

@NicoMiceli
Forked from tamirko/gotoCell.js
Created October 12, 2018 18:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save NicoMiceli/3140d37bd4ae6977a6c0d9563c651219 to your computer and use it in GitHub Desktop.
Save NicoMiceli/3140d37bd4ae6977a6c0d9563c651219 to your computer and use it in GitHub Desktop.
How to go to a specific cell in a Google sheet ?
function onOpen()
{
var menuEntries = [{name: "Go to", functionName: "goToCell"}];
SpreadsheetApp.getActiveSpreadsheet().addMenu("MyUtils", menuEntries);
}
function goToCell()
{
var strRange = Browser.inputBox("Insert the required cell (e.g.: B351):", Browser.Buttons.OK_CANCEL);
if(strRange != "cancel")
{
try
{
SpreadsheetApp.getActiveSheet().getRange(strRange).activate();
}
catch(e) {Browser.msgBox(e.message);}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment