Hyperlink to a specific sheet

后端 未结 6 2067
猫巷女王i
猫巷女王i 2021-02-08 01:45

I would like to open a specific sheet of a Google Sheets from a hyperlink in another spreadsheet.

I have different links in my master spreadsheet and each should have a

6条回答
  •  太阳男子
    2021-02-08 02:23

    In case you want to create a link to another sheet which will open the sheet in the same browser tab here is what you want to do: 1. Get the id of the sheet. Check the link in your browser and you will see #gid=x where x is the sheet id 2. Then you want to set the formula (hyperlink) to the cell and make it show as a hyperlink SpreadsheetApp.getActiveSheet().getRange("A1").setFormula('=HYPERLINK("#gid=X","test")').setShowHyperlink(true); If you don't use setShowHyperlink(true) it will be shown as a regular text.

    This is basically a code version for the update provided by @rejthy above

提交回复
热议问题