Skip to content Skip to sidebar Skip to footer

How Could I Get The Link Of An Specific Sheet With Google Script?

I have a spreadsheet with many sheets. Each sheet is a report and has a different link. How could I get the link of this active sheet? Eg: Output > The link of the report is ava

Solution 1:

Your 'here' link doesn't work, however, in lieu of that, it is possible to create a public hyperlink to a specific sheet.

When you open the Google Sheet and navigate the sheets in your browser, you will notice that there is an anchor element to the URL that is #gid=some_number .

Appending that same #gid=some_number piece to any hyperlink you have for the spreadsheet will link directly to that sheet.

If you are generating the sheets programmatically using a script, so don't know the gid in advance, then you will need to use the getSheetID function in your Google Script

Solution 2:

Good luck!

var thisDocumentUrl = SpreadsheetApp.getActiveSpreadsheet().getUrl();

Post a Comment for "How Could I Get The Link Of An Specific Sheet With Google Script?"