Members-only tutorial
Watch the video and get the practice sheet with membership.
About this Tutorial
Video Transcript
<div>0:00 Just had the request to add an automatic duplicator, so one of the features of SheetLord here, where Learn how to filter data in Google Sheets using the query where clause. Opens in new tab we have one keyword and then we have a bunch of awesome links that we can copy and paste and open with multiple links, is we want to save a sheet or two, right, so if we search for something and we're<br>0:20 like, oh, we want to search for this again, this Google Sheets keyword, we want to duplicate Understand the concept of duplicating sheets in Google Sheets. Opens in new tab and add here, Google Sheets, but we can get Apps Script Explore Google Apps Script for automating tasks in Google Sheets. Opens in new tab to do this for us, so let's delete this and do that with Apps Script Explore Google Apps Script for automating tasks in Google Sheets. Opens in new tab , let's go to extensions, Apps Script Explore Google Apps Script for automating tasks in Google Sheets. Opens in new tab , we have our functions Get familiar with functions in Google Sheets for better data manipulation. Opens in new tab here, we have function Dive into the basics of functions and how they work in Sheets. Opens in new tab <br>0:46 reset checkboxes and on open like this.
Let's create another function Dive into the basics of functions and how they work in Sheets. Opens in new tab , duplicate Understand the concept of duplicating sheets in Google Sheets. Opens in new tab , and we want to add it to our on open, so we can add a new row here and call this duplicate Understand the concept of duplicating sheets in Google Sheets. Opens in new tab , and we'll say duplicate Understand the concept of duplicating sheets in Google Sheets. Opens in new tab current sheet Find out what the current sheet is and how to reference it. Opens in new tab , and So here's a few things we need, we need variable.<br>1:12 Key word, that's going to be equals spreadsheet Learn about spreadsheets and their structure in Google Sheets. Opens in new tab app dot get active sheet Understand the active sheet concept and its importance in Sheets. Opens in new tab , get range Discover how to work with ranges in Google Sheets for data selection. Opens in new tab , and that's going to be B2, for right now, B2, get value.<br>1:29 So now we know the key word, now we just need to create a new sheet, well we need one more thing we need very variable, SS equals spreadsheet app dot get active spreadsheet, this is the entire spreadsheet that exists right now, so we're going to go SS dot get, get sheet by name, actually sorry, we are<br>1:53 going to do SpreadsheetApp.getActiveSheet.getActiveSheet.
copy to Learn how to copy data or sheets to another location in Google Sheets. Opens in new tab , and we're going to copy it to the spreadsheet Learn about spreadsheets and their structure in Google Sheets. Opens in new tab that we're in, so just use SS.<br>2:07 Let's move this up a little bit to the middle of the screen, and then we're going to set name to, well we need actually two things, right?<br>2:17 We need the name of the sheet we're on right now, Machine name equals, we're going to get the add.
Active sheet Understand the active sheet concept and its importance in Sheets. Opens in new tab again, get name, so we can get that sheet name Understand how to retrieve and use sheet names in your formulas. Opens in new tab , plus, and then we'll put a colon, a space, and then a plus, keyword.<br>2:41 Let's save this, and now to get it in the, on open, we need to close Apps Script Explore Google Apps Script for automating tasks in Google Sheets. Opens in new tab , and we need to refresh our sheet or close it.<br>2:48 Close it and open it again, so we're on search, search lord menu up here on the top right, duplicate Understand the concept of duplicating sheets in Google Sheets. Opens in new tab current sheet Find out what the current sheet is and how to reference it. Opens in new tab , now we have it, done.<br>3:01 So some extra things we could do to make this a little bit better is maybe we don't want to duplicate Understand the concept of duplicating sheets in Google Sheets. Opens in new tab about sheets or how to use.<br>3:10 Maybe we only want to duplicate Understand the concept of duplicating sheets in Google Sheets. Opens in new tab it when we're on search or search some, so we will, we get the name here, so if sheet name Understand how to retrieve and use sheet names in your formulas. Opens in new tab is equal to search or two pipes is the or sheet name is equal to search some, and then we'll put this function in curly brackets, and we'll only put this here.<br>3:48 Let's format document, else, we will give a little message, so spreadsheet app dot get active sheet Thank you.
Spreadsheet Learn about spreadsheets and their structure in Google Sheets. Opens in new tab app dot get active toast can only copy search and search some, or, and let's capitalize this just to keep it the same search some, there we go, so now we're duplicating the sheet<br>4:22 , adding the keyword, and, doing that from this search lord menu, so if we're on how to use, let's duplicate Understand the concept of duplicating sheets in Google Sheets. Opens in new tab current sheet Find out what the current sheet is and how to reference it. Opens in new tab , can only copy search or search some, perfect, that allows us to add maybe some more sheets here later on if we need to, if we're adding more sheets, more ways to search, pretty <br>4:45 cool, right? that was a way to automatically duplicate Understand the concept of duplicating sheets in Google Sheets. Opens in new tab .
a sheet based on user needs.</div>