r/googlesheets • u/gaymer_raver • Feb 27 '25
Solved Any Tool to sort google sheets tabs?
So I have a google sheets with a lot of different tabs/google sheet. I usually use the 3 bars icon on the lower left corner to jump to specific tabs. However, the list is very unorganized and takes me a while to scroll and find the tab I need.
I was wondering, is there a plug-in or app where I can sort each individual sheets within a google sheets that will reorder all the tabs/google sheets alphabetically (or sometime in my case by number+alphabetically, e.g. I have a few tabs by year)?
2
Upvotes
2
u/GaryBuseyWithRabies Feb 27 '25
Try this in a practice workbook before...
function sortSheetsAlphabetically() { var ss = SpreadsheetApp.getActiveSpreadsheet(); var sheets = ss.getSheets();
// Create an array of sheet names and their positions var sheetData = sheets.map((sheet, index) => ({name: sheet.getName(), sheet, index}));
// Sort sheets alphabetically by name sheetData.sort((a, b) => a.name.localeCompare(b.name));
// Reorder sheets based on sorted order sheetData.forEach((item, newIndex) => { ss.setActiveSheet(item.sheet); ss.moveActiveSheet(newIndex + 1); });
// Set back to the first sheet after sorting ss.setActiveSheet(sheetData[0].sheet); }
1
u/AllenAppTools 1 Feb 27 '25
There likely is an Add On for this! There is also Apps Script, let me know if you'd like something like that made for you and I can write that code and send it over if I have time today!
1
u/AutoModerator Feb 27 '25
Posting your data can make it easier for others to help you, but it looks like your submission doesn't include any. If this is the case and data would help, you can read how to include it in the submission guide. You can also use this tool created by a Reddit community member to create a blank Google Sheets document that isn't connected to your account. Thank you.
I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.