WeirdGeek

Data Science | Machine Learning | Automation

  • Data Analytics
  • Python
  • Data Science
  • Google Apps Script
  • Machine Learning
  • Artificial Intelligence
  • SQL Server

08/03/2020 By WeirdGeek Leave a Comment

Navigate from one Google Sheet to another using GAS

When you are building a toolkit or a dashboard in Google sheets you have came across a situation where you want to navigate from one google sheet to another on a button click. Here in this post we will see how you can navigate or move from one google sheet to another using Google Apps Script (GAS).

Navigate from one google sheet to another using Google Apps Script

Code to navigate/move from one google sheet to another using Google Apps script:

function NavigatefromOneSheettoAnother() {
    //Its a container bound script. Activating the active spreadsheet
    var spreadsheet = SpreadsheetApp.getActive()
    //Replacing the Sheet_name with the respective name to which you want to navigate on a click.
    spreadsheet.setActiveSheet(spreadsheet.getSheetByName('Sheet_name'), true);
}

Here in the above code we are activating the spreadsheet that we are using and inside which we are writing container bound script. After that, we are passing the sheet name as argument inside the .setActiveSheet() function which will activate the respective on a click.

Now once you create the script, just go to the image which you want to use as a button and assign the function name to that image, by right clicking to the image and clicking on the three dots icon on top right and choose assign script.

That’s it now, just click and see the magic.

To get more detailed knowledge about Google Apps Script, you can check the official website. Also if you want to explore more codes/posts related to Google Apps Script on our website, then you can find it here.

If you have any questions or if you need any help please get in touch with me using the comment section below.

Related posts:

  1. Google Apps Script to search a string in Google Sheet [Part II]
  2. Google Apps Script to search a string in a column in Google Sheet [Part 1]
  3. Import CSV file data to Google Spreadsheet using Google Apps Script
  4. Google Apps Script Code to find the days of the week

Filed Under: Google Apps Script Tagged With: GAS, Google Apps Script, Google Sheets

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Subscribe to my Blog !!

Enter your email below to subscribe my blog and get the latest post right in your inbox.

  • Home
  • Terms
  • Privacy
  • Contact Us

Copyright © 2025 · WeirdGeek · All trademarks mentioned are the property of their respective owners.