Select a sheet

Here is how to select or activate a sheet.

Source code

function selectSheet() {
  var targetName = "2nd sheet";
  var spreadsheet = SpreadsheetApp.getActiveSpreadsheet();
  var sh = spreadsheet.getSheetByName(targetName);
  sh.activate();
}

Steps

(1) Get a target sheet object

Please refer the following post;

Get a sheet object by name

(2) Activate a targeted sheet

Please refer the following post;

Activate a sheet

Leave a Comment