Members-only tutorial
Watch the video and get the practice sheet with membership.
About this Tutorial
Sheet Resources
Video Transcript
<div>0:00 So, common in project management and any kind of task management as well, we have a series of rows that have information in them, maybe a little bit of information or a lot of information, and we find ourselves, based on some status or something happening, we want to copy it to another tab.<br>0:20 We want to just copy it.
We don't want to get rid of it, we don't want to move it, we don't want to do anything.<br>0:24 Now, one common thing you might think of doing is, let's say we're going to duplicate Learn how to duplicate data in your Google Sheets effectively. Opens in new tab this and we're going to create a list of all the on-hold projects.<br>0:33 We'll create a tab called on-hold, we will delete all of everything here, and instead of these stages, we will just have a list of projects, and we'll use filter Discover how to use filters to manage your data in Sheets. Opens in new tab .<br>0:44 Now, filter Discover how to use filters to manage your data in Sheets. Opens in new tab seems like it's going to work, because we can use filter Discover how to use filters to manage your data in Sheets. Opens in new tab and we can say, hey, this condition Understand how to set conditions for your data manipulation. Opens in new tab , this E, is equal to true.<br>0:52 Now, we have no, nothing here, no projects.
But if we put a couple on-hold, come back, and we now see we have.<br>1:00 The information we want. We can actually just get the product name, project name if we want, and that means we can add some more data Explore different types of data you can manage in Google Sheets. Opens in new tab here.<br>1:09 But, the thing is, if I have this data Explore different types of data you can manage in Google Sheets. Opens in new tab , and I'm seeing it, I can't edit it. Watch, if I try to delete Facebook, I'm literally hitting delete.<br>1:21 Or, if I say Facebook project, I rename it here, for some reason. I get a reference Get insights on handling reference errors in your Sheets. Opens in new tab error Find out common errors in Sheets and how to fix them. Opens in new tab . This filter Discover how to use filters to manage your data in Sheets. Opens in new tab is only going to pull data Explore different types of data you can manage in Google Sheets. Opens in new tab into the to this tab.<br>1:32 And, it's not allowing me to edit it.
It's not allowing me to do anything to it. I could, perhaps, copy paste the values Learn about the importance of values in your spreadsheet. Opens in new tab .<br>1:42 That's what I just did there, getting rid of the formula Master the syntax rules for writing formulas in Sheets. Opens in new tab . But, now, if something else goes on hold, like this Bucky's project, it's not going to work.<br>1:49 There's no filter Discover how to use filters to manage your data in Sheets. Opens in new tab function Understand how to create and use functions in Google Sheets. Opens in new tab anymore. So, how do we copy, when we click on hold, how do we copy to Learn how to copy data to another tab in your spreadsheet. Opens in new tab the on hold tab?<br>1:59 And based on. What we want, we maybe just want a little bit of data Explore different types of data you can manage in Google Sheets. Opens in new tab . We're just going to get the project name for now.<br>2:05 Well, we're going to need Apps Script Get started with Apps Script to automate your Sheets tasks. Opens in new tab for this, and it's actually much simpler than you think.
Apps Script Get started with Apps Script to automate your Sheets tasks. Opens in new tab wise, coding wise, I'm going to code the whole thing right here for you.<br>2:14 Basically, we're looking at projects tab, and we're saying anytime there's an edit, if it's in this column four, and we're changing a check box from false to true, then we want to copy that data Explore different types of data you can manage in Google Sheets. Opens in new tab .<br>2:26 So, let's look at our Apps Script Get started with Apps Script to automate your Sheets tasks. Opens in new tab and see what we need to do. We're going to call it move on hold.<br>2:35 On hold. And we're going to write a function Understand how to create and use functions in Google Sheets. Opens in new tab here. This is what's called a simple trigger Discover how to use simple triggers for automation in Sheets. Opens in new tab on edit.
And that's all we need to write for the function Understand how to create and use functions in Google Sheets. Opens in new tab to work, is on edit with a capital E.<br>2:48 We need some event object Learn about the event object in Apps Script for tracking changes. Opens in new tab , something that's going to hold all the data Explore different types of data you can manage in Google Sheets. Opens in new tab of what is actually being edited, what values Learn about the importance of values in your spreadsheet. Opens in new tab are being edited.<br>2:55 We can call this event. Sometimes we call this E, just to make it five. 80% faster to type E. We can call it event right now.<br>3:06 And what we want to do from this event is gather the information. We want a variable of what is the value, like checkbox Understand how to work with checkboxes in your Sheets. Opens in new tab value.<br>3:16 Checkbox Understand how to work with checkboxes in your Sheets. Opens in new tab . We'll call it checkbox Understand how to work with checkboxes in your Sheets. Opens in new tab value equals event dot value.
So that's just saying what is the new value that's being edited.<br>3:26 We're going to log that right now, and I'm going to show you what that looks like. Vlogger. Checkbox Understand how to work with checkboxes in your Sheets. Opens in new tab value. We're going to log this checkbox Understand how to work with checkboxes in your Sheets. Opens in new tab value.<br>3:34 I'm going to save and I'm going to go back and I'm going to just delete Nike, and then I'm going to click go here.<br>3:42 Um, and let's click on hold, and I'm going to then look at our executions and see what was actually logged here.<br>3:56 It will refresh. Takes a little bit of time to refresh sometimes. So I just did it again.
Here I'll type in, instead of, I'll type in Nike's project, we'll go back here and we'll see, is this the one?<br>4:12 Now they're coming in fast and furious. Sometimes it takes a little bit of time. Google's servers have to go get it, save it, get it, and then bring it back and log it.<br>4:22 So we'll refresh a few times. And again, this may take a little bit of time oh I see what I did this is checkbox Understand how to work with checkboxes in your Sheets. Opens in new tab value.<br>4:31 I don't know why that happened. We just want value there. So go back, let's change this. We'll make sure it's saved.<br>4:40 Let's change this to Nike.
And we will look again at our execution. And there we have the information Nike. So it is saving that value in the database and saying hey, we edited the script, or we edited the sheet, we are going to change this from false to true, and let's go look at it.<br>5:01 Our edit, and here we see it is all caps true. So we are saving that data Explore different types of data you can manage in Google Sheets. Opens in new tab . So let's go and actually work with this and say based on that value, based on where Explore how to use query and where clauses in your data. Opens in new tab it is, we can also get variable row equals event dot range Learn about selecting ranges in Google Sheets for data manipulation. Opens in new tab dot get row.<br>5:18 We can also get the column. Column equals event. range Learn about selecting ranges in Google Sheets for data manipulation. Opens in new tab .getColumn, in this case.
And now, based on that information, if I'm going row is equal to, actually row is greater than two, meaning it's not in the header Understand the role of headers in organizing your spreadsheet data. Opens in new tab , it's not in the first two column, first two rows.<br>5:41 And column is equal to the E column here, which is number Get familiar with number formatting and types in Sheets. Opens in new tab five. It's the fifth. We need to use a five here.<br>5:50 Fifth column. If that's the case. And, one more and, double ampersand. Checkbox Understand how to work with checkboxes in your Sheets. Opens in new tab value is equal to true. Need one more.<br>6:02 Is equal to true. Then we want to copy this data Explore different types of data you can manage in Google Sheets. Opens in new tab . Over.
We got the row, so we know we can go spreadsheet Explore the features and functionalities of Google Sheets. Opens in new tab app dot get active spreadsheet Learn how to access the active spreadsheet in Apps Script. Opens in new tab .<br>6:14 We also have to make sure it's on projects actually. That's the last thing we need to do. So variable sheet equals spreadsheet Explore the features and functionalities of Google Sheets. Opens in new tab app dot get active of sheet.getSheetName.<br>6:26 And we also double ampersand one, make sure sheet. Is equal to projects. Get the active sheet Understand how to work with the active sheet in your spreadsheet. Opens in new tab , which is the project sheet.<br>6:38 Get range Learn about selecting ranges in Google Sheets for data manipulation. Opens in new tab , row, uh column is one, and it is one by one row column. We just want the name. So we go variable project name equals. So we got the project name.
Now we need to put it into on hold so we're going to see spreadsheet Explore the features and functionalities of Google Sheets. Opens in new tab app.<br>7:02 Uh actually we need get sheet by name. Here. Projects. There we go. That's going to work now. Now we say spreadsheet Explore the features and functionalities of Google Sheets. Opens in new tab app dot get active spreadsheet Learn how to access the active spreadsheet in Apps Script. Opens in new tab .<br>7:21 Now we want get sheet by name. On hold. Oh move my face. Let's make sure we go on hold. Is that correct spelling, all caps.<br>7:31 Projects. Get sheet by name. Get range Learn about selecting ranges in Google Sheets for data manipulation. Opens in new tab . We want the range Learn about selecting ranges in Google Sheets for data manipulation. Opens in new tab to be uhm we need the last row plus one.<br>7:49 And we only want one one column one and only one cell by one thing.
So let's get the last row.<br>7:57 Let's get on hold, paste it here. dot get last row. That's all we need to do. Get last row. Now we get the range Learn about selecting ranges in Google Sheets for data manipulation. Opens in new tab and we set value.<br>8:11 And we are setting the value that we got up here which is project name. So let's do that. So every time now if we click here ivy we should paste it here.<br>8:28 Ah I see an error Find out common errors in Sheets and how to fix them. Opens in new tab that I made variable last row. O is equal to the last row. There we go.<br>8:34 Let's try that again. We're going to not delete it. Oh. Let's get ivy. Nike and ivy.
And we're getting range Learn about selecting ranges in Google Sheets for data manipulation. Opens in new tab .<br>8:47 Ah that's probably because we are getting the project name we have to add get value here. That's very common to forget.<br>8:54 We're getting the range Learn about selecting ranges in Google Sheets for data manipulation. Opens in new tab and we think ok we got that cell. But we actually have to get the value out of that cell.<br>8:59 I'll actually save that. Let's delete these. Now we want Bose and Facebook. And let's see if that worked. We're getting Facebook.<br>9:11 Grand. Fantastic. Grand. Let's see maybe we did it a little too fast. Yet to be named Nike. Perfect. Thumbs up.<br>9:21 It's working now.
We are able to copy any data Explore different types of data you can manage in Google Sheets. Opens in new tab once we have this checkbox Understand how to work with checkboxes in your Sheets. Opens in new tab , this specific checkbox Understand how to work with checkboxes in your Sheets. Opens in new tab checked. And we've done that with Apps Script Get started with Apps Script to automate your Sheets tasks. Opens in new tab pretty simply.<br>9:32 Right, just getting the check, checkbox Understand how to work with checkboxes in your Sheets. Opens in new tab value, is it true or false, getting the row, the column of this event, getting the sheet that we're on, making sure we're on the correct sheet, getting the right value in the right place, the right row, the right column, getting the project name which is just the<br>9:47 value from a range Learn about selecting ranges in Google Sheets for data manipulation. Opens in new tab , getting the last row where Explore how to use query and where clauses in your data. Opens in new tab we're supposed to go with it, adding one, and then setting that value.<br>9:52 There you go.
Hope this was helpful to you on how to copy to Learn how to copy data to another tab in your spreadsheet. Opens in new tab a new tab when something is checked here.</div>