If I have a Google Sheets document (Workbook in Excel terms) with 20 sheets (Worksheet in Excel terms) and I want to rearrange the order of the sheets currently the only way I know to do this is to drag them horizontally.

This works fine when you have a few sheets, but with 20 or more sheets its very slow if I want to take sheet 20 and put it next to sheet 1. Ive also noticed that if you right click a sheet you have the option to move it left or right, but this only moves in one sheet "slot" at a time, so no quicker than the dragging method.

Is there a quicker way to do this than just dragging a sheet horizontally along the bottom bar?


You could use Google Apps Script to reorder the sheets. First you should activate the sheet to move, either manually or by the script, then use the moveActiveSheet(position) method of the Class Spreadsheet.


This moves the active sheet to the position 1

function moveSheetToPos1(){



No, this is the only way to shuffle the individual sheets on the sheet bar.

Note: maybe this would be possible with a script which will randomly shuffle sheets' gids based on a pre-defined trigger (not sure if...)


Here is the Apps Script :

/* Credit: https://gist.github.com/chipoglesby/26fa70a35f0b420ffc23 */

function sortGoogleSheets() {

  var ss = SpreadsheetApp.getActiveSpreadsheet();

  // Store all the worksheets in this array
  var sheetNameArray = [];
  var sheets = ss.getSheets();
  for (var i = 0; i < sheets.length; i++) {


  // Reorder the sheets.
  for( var j = 0; j < sheets.length; j++ ) {
    ss.moveActiveSheet(j + 1);

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.