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 Learn about Apps Script and how it can automate tasks in Google Sheets. Opens in new tab . It's a very simple thing. It's three lines.
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 Discover what functions are and how they enhance your spreadsheet capabilities. Opens in new tab . 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 Understand the basics of spreadsheets and their structure. Opens in new tab file.<br>0:50 And all we need to know is how many total sheets there are.
So this is SS, which is SpreadsheetApp Explore the SpreadsheetApp class for managing Google Sheets. Opens in new tab .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 Get insights into how numbers are used in functions and formulas. Opens in new tab .<br>1:09 Which place do you want it? Do you want it number Get insights into how numbers are used in functions and formulas. Opens in new tab one, number Get insights into how numbers are used in functions and formulas. Opens in new tab two, number Get insights into how numbers are used in functions and formulas. Opens in new tab three? In this case, the total number Get insights into how numbers are used in functions and formulas. Opens in new tab of tabs or sheets inside of our spreadsheet Understand the basics of spreadsheets and their structure. Opens in new tab file is the place that we want it.<br>1:20 So in this case, it's going to be number Get insights into how numbers are used in functions and formulas. Opens in new tab 51.
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 Discover what functions are and how they enhance your spreadsheet capabilities. Opens in new tab , 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 Discover what functions are and how they enhance your spreadsheet capabilities. Opens in new tab . It's going to give us two functions Dive into the world of functions and their applications in spreadsheets. Opens in new tab that are going to be available in our sheet.<br>1:57 And I'll show you that really quickly.
We're I'm just copying and pasting it from better sheets. We're going to call this custom menu Find out how to create custom menus to streamline your workflow. Opens in new tab .<br>2:03 We are going to use function Discover what functions are and how they enhance your spreadsheet capabilities. Opens in new tab move tab to far right as the first item. We're going to rename this move to Learn how to move sheets within your spreadsheet efficiently. Opens in new tab 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 Learn how to move sheets within your spreadsheet efficiently. Opens in new tab far left.<br>2:20 But we will create that in a second.
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 Find out how to create custom menus to streamline your workflow. Opens in new tab and we have move to Learn how to move sheets within your spreadsheet efficiently. Opens in new tab far right, move to Learn how to move sheets within your spreadsheet efficiently. Opens in new tab 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 Learn about Apps Script and how it can automate tasks in Google Sheets. Opens in new tab , we can move to Learn how to move sheets within your spreadsheet efficiently. Opens in new tab far right.<br>2:43 There it is. But let's make the far left one as well. Go to Apps Script Learn about Apps Script and how it can automate tasks in Google Sheets. Opens in new tab . This one's even easier to make.<br>2:50 We're going to copy this function Discover what functions are and how they enhance your spreadsheet capabilities. Opens in new tab move tab to far right. We're going to call this far left.
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 Understand the basics of spreadsheets and their structure. Opens in new tab 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 Find out how to create custom menus to streamline your workflow. Opens in new tab 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.
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 Get insights into how numbers are used in functions and formulas. Opens in new tab one, move to Learn how to move sheets within your spreadsheet efficiently. Opens in new tab far left. Oh, it's already in the far left, far right.<br>3:50 There it is. Number Get insights into how numbers are used in functions and formulas. Opens in new tab one. And if we want to move it back to the far left, that's number Get insights into how numbers are used in functions and formulas. Opens in new tab one. There you go.<br>3:56 So again, if you are a BetterSheets member, down below is a link to this particular video.
There's a spreadsheet Understand the basics of spreadsheets and their structure. Opens in new tab file, and you can get this Apps Script Learn about Apps Script and how it can automate tasks in Google Sheets. Opens in new tab .<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 Learn about Apps Script and how it can automate tasks in Google Sheets. Opens in new tab you can use in your sheet.</div>