Skip to content

Instantly share code, notes, and snippets.

@rubenrivera
Created May 2, 2018 02:58
Show Gist options
  • Save rubenrivera/591197229149022eb2e4ddc89be91094 to your computer and use it in GitHub Desktop.
Save rubenrivera/591197229149022eb2e4ddc89be91094 to your computer and use it in GitHub Desktop.
Go To Macro. Shows a prompt on which the user set the address of cell to quickly jump into.
// Related Q&A https://webapps.stackexchange.com/q/116736/88163
function GoTo() {
var spreadsheet = SpreadsheetApp.getActive();
var Ui = SpreadsheetApp.getUi();
var buttons = Ui.ButtonSet.OK_CANCEL;
var response = Ui.prompt('Go to', 'Where do you want to go?', buttons);
if(response.getSelectedButton() === Ui.Button.OK){
var address = response.getResponseText();
spreadsheet.getRange(address).activateAsCurrentCell();
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment