Move Sheets in Google Sheets Using Keyboard

google sheetskeyboard shortcuts

I want to rearrange the sheets in my workbook. I have many sheets and moving the last one to the front is very slow with drag and drop.
Ideally I want a command that will select a sheet and move it to the first position.
Is this possible?

OR, the sheet names are "month year" perhaps they can be sorted?

Best Answer

This script will allow you to move the active sheet to the beginning or a pick sheet that needs to be moved.

Code

// global
var app = SpreadsheetApp.getUi();
var ss = SpreadsheetApp.getActiveSpreadsheet();

// create menu entry in spreadsheet upon opening
function onOpen() {
  app.createMenu('Move Sheet')
    .addItem('Move Active', 'moveactiveSheet')
    .addItem('Move Sheet', 'movespecificSheet')
    .addToUi();  
}

// move active sheet to position zero
function moveactiveSheet() {
  ss.moveActiveSheet(0);  
}

// select sheet number (correct for zero-based array) and move to front
function movespecificSheet() {
  var int = app.prompt('Select Sheet', 'Use int. only', app.ButtonSet.OK_CANCEL)
    .getResponseText();
  ss.setActiveSheet(ss.getSheets()[int-1]);
  ss.moveActiveSheet(0);  
}

Example

I've created an example file for you: move sheets.
Make a copy of my file or add the code under Tools > Script editor. Press the bug button to authenticate the script.