Skip to content

Instantly share code, notes, and snippets.

@kamesuke42
Last active October 4, 2023 08:02
Show Gist options
  • Save kamesuke42/672eb80d1b4a25b80e6a59d94e324c73 to your computer and use it in GitHub Desktop.
Save kamesuke42/672eb80d1b4a25b80e6a59d94e324c73 to your computer and use it in GitHub Desktop.
開いているスプレッドシートのシートを一番後ろの一個左に移動させる
function myFunction() {
const mySheet = SpreadsheetApp.getActiveSpreadsheet();
const sheetNum = mySheet.getNumSheets();
mySheet.moveActiveSheet(sheetNum - 1);
}
function onOpen() {
const ss = SpreadsheetApp.getActiveSpreadsheet();
const menus = [];
menus.push({name: '最後尾に移動', functionName: 'myFunction'});
ss.addMenu("menuTest", menus);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment