0
votes

I have a project management spreadsheet, which has many sheets. in order to keep things tidy, i like to keep them hidden, and show\hide according to my needs usind a script. i have a sheet which contains a list of all tasks and a link to their original sheet.

the link leads to the correct URL, but then it changes to that of the last visible sheet.

i've tried using the following function:

function onOpen(){
  SpreadsheetApp.getActiveSheet().showSheet();
}

because i thought the hidden sheet is active on document open, but with no luck.

Any ideas?

Thanks for the help!

1

1 Answers

2
votes

I am not sure I understand exactly what you want to do, but if you want to unhide a sheet and activate it you can do this:

function onOpen(){
  var ss = SpreadsheetApp.getActiveSpreadsheet()
  var s = ss.getSheets()[1]
  s.showSheet().activate()

}