Members-only tutorial
Watch the video and get the practice sheet with membership.
About this Tutorial
Sheet Resources
Video Transcript
<div>0:00 So you want to move a tab over to the left or the right and you don't want to do it manually, which I've shown in a really quick video how to literally click and drag this sheet around.<br>0:13 We can reorder these sheets physically, manually, but gosh, it takes a long time if you have a lot of tabs.<br>0:20 So how do we get this sheet one or this active tab to actually move over to the far right without having to click and drag it?<br>0:27 I'm going to show you in Extensions, Apps Script . It's a very simple thing. It's three lines. How To Add Columns in Google Sheets When Urgent, Move to Top of Google Sheet How to Lock Multiple Tabs at Start of Sheets List in Google Sheets
You can copy it from this video.<br>0:34 If you are a member of BetterSheets, you can get this sheet down below. If you're watching this on YouTube, become a BetterSheets member today.<br>0:42 So here's function . Move tab to far right. We can name this anything we want. We're going to use a constant SS just to say get the entire spreadsheet file.<br>0:50 And all we need to know is how many total sheets there are. GPT in SHEETS Get Sheet ID and Tab GID Into Your Google Sheet How to Protect Spreadsheet From Yourself
So this is SS, which is SpreadsheetApp .getActiveSpreadsheet.getSheets.length, getting how many tabs are there.<br>1:02 And then we're going to use one line, which is SS.moveActiveSheet. And we're going to set an integer. And this is a specific number .<br>1:09 Which place do you want it? Do you want it number one, number two, number three? In this case, the total number of tabs or sheets inside of our spreadsheet file is the place that we want it.<br>1:20 So in this case, it's going to be number 51. Getting Started Coding in Apps Script Get Sheet ID and Tab GID Into Your Google Sheet How to Lock Multiple Tabs at Start of Sheets List in Google Sheets
So if I run this and I go back, you can see sheet one is now in the 51st place.<br>1:30 That's pretty awesome. But we can make this far, far easier to use. You don't have to just come to this function , hit run in here.<br>1:37 We can make it far easier to use, especially if you have other users trying to use this. We're going to go to bettersheets.co slash snippets.<br>1:51 And we're going to get this custom function . It's going to give us two functions that are going to be available in our sheet.<br>1:57 And I'll show you that really quickly. Advanced Coding in Google Sheets for Programmers GPT in SHEETS Advanced Coding in Google Sheets for Programmers Random Number Between 1 and 100
We're I'm just copying and pasting it from better sheets. We're going to call this custom menu .<br>2:03 We are going to use function move tab to far right as the first item. We're going to rename this move to right.<br>2:13 We'll say far right. And the second item we will name, we want to do another one called move to far left.<br>2:20 But we will create that in a second. ChatGPT Clone in Google Sheets Custom Menu - 2 functions Generate Short Random Codes or IDs
Save this and go back to our sheet and refresh it and you'll see something is different.<br>2:29 And you'll see in the help column, we have a custom menu and we have move to far right, move to far left.<br>2:34 So let's test this out. Let's take the sheet one, move it back over a little bit. And without having to go to Apps Script , we can move to far right.<br>2:43 There it is. But let's make the far left one as well. Go to Apps Script . This one's even easier to make.<br>2:50 We're going to copy this function move tab to far right. We're going to call this far left. Getting Started Coding in Apps Script When Urgent, Move to Top of Google Sheet Go To Random Row Custom Function
We're also going to make sure it's available in our menu up here.<br>3:03 And we do not need to know how many sheets are in our spreadsheet file. We just need to move it to position one.<br>3:10 That's it. So that's the far left is position one. So let's close this, refresh our tab so that that custom menu refreshes again, loads up, and we have moved to far left, moved to far right.<br>3:24 Let's click move far left. So now it is in position 1, and we can move this, as much as we want back and forth, back and forth.<br>3:33 We can move this daily, weekly, hourly, minute by minute. 80 Years In 1 Spreadsheet Move Row Based on Dropdown
This is really cool. So now you can move your tab to either end very, very easily.<br>3:42 And you can do any active one. Let's do number one, move to far left. Oh, it's already in the far left, far right.<br>3:50 There it is. Number one. And if we want to move it back to the far left, that's number one. There you go.<br>3:56 So again, if you are a BetterSheets member, down below is a link to this particular video. Absolute Basics of Google Sheets How to Move Row To Section in Google Sheets
There's a spreadsheet file, and you can get this Apps Script .<br>4:03 If you're not a member, just copy the script, and go check out bettersheets.co slash snippets for more Apps Script you can use in your sheet.</div> Automatically Copy Spreadsheet Tab to New File with Values Only, No Formulas What's Better Than Google Sheets? Access Free API's with Google Sheets What is a Spreadsheet? Anatomy of a Spreadsheet