Move Completed to Bottom of Google Sheet

Learn how to automate the process of moving completed tasks to the bottom of your Google Sheets using Google Apps Script. This tutorial walks you through the necessary code and logic to streamline your task management.

We have a series of tasks and we want to change the status to completed, but we don't want to just leave these tasks at the top. We don't actually want to come to our sheet and see completed at the top. We want it at the bottom. So let's automate that. Go up to Extensions app script . We can change this function to move when completed. Completed, and when we want this to move is going to be on an edit so we can create a function on edit with a capital E with an event here, or just e. And we can say if E range do GI Row is greater than one. Double ampersand, E range do get column. Column with a capital C is equal to two, meaning it is the B column here. Automated Project Management in Google Sheets Automated Project Management in Google Sheets Automated Project Management in Google Sheets Add New Task when Task Completed

When we're editing that, then. Once those two are both true, we're going to run the function move when completed. So what is that function going to do? We will inherit the E event. So we get variable E variable row equals E range get row. We want to know what the last row is. Spreadsheet app, get active sheet dot get last row. We also need the active sheet . I wanna take the active sheet . Do get range . We want the row. We're on one column and we know we're gonna use two. Sorry, one first column. And then we know we want only one row and we know we want two columns. So in this case, we only have two columns here. Spreadsheet Automation 101 Lesson 2: onEdit() Trigger Learn to Code in Google Sheets, For Programmers | For Advanced Google Sheet Users When Urgent, Move to Top of Google Sheet Move Row Based on Dropdown

Maybe you have more or you wanna get the maximum columns. So if you wanna do that, max Columns will create a variable. Max call equals active. Get max columns and we're gonna take this range and we're gonna copy two. The active sheet get range , last row plus 1 1, 1 column max call. So now this will copy to the very last row plus one. So we're gonna go down to 1 0 5 here and then add one and it'll be 1 0 6 and we'll copy it there. So let's see if this all works. Save it. And now we're running it on edit, so we just need to change this to completed and this update client database. Add Columns Automatically Absolute Basics of Google Sheets Basic CRM - Add a Powerful Script To Move Row Based on Status Copy Date to Next Cell Automatically

We have an undefined range at code line eight. So we probably need to add here e to inherit this event through. So let's save that and changes to complete it again. And now we have update client database down here. We also need to make sure that we're changing it to completed, so we want e do value with ampersands to be equal to completed. So we need three. Variables here. We need the row to be greater than one, so it's not the header row . We need the column to be two, and we wanna make sure that it actually is completed, the text in that cell, or we're gonna get something like this. But it's working. Now we have two things copied. Now that we're moving these things down, we've copied them from here Basic CRM - Add a Powerful Script To Move Row Based on Status How To Create a Stop Watch in Google Sheets Move Row Based on Dropdown

down, we wanna delete this row, so let's go back and go active, delete. Row. In which row are we gonna delete the row? We're coming from this row right here. Save. And now the move is going to be, we're gonna first copy it and then delete it. So prepare meeting slides is deleted now and it's at the bottom. Fantastic. Can also delete this one. And here, just check again. Completed. Send follow up emails. And now it's at the bottom. Cool. We're now moving completed to the bottom of the Google sheet. Thanks for watching. This is the entire code you need. Make sure you have all the capitalization correct. Sometimes this on edit with a capital E is not capitalized and this e inside of Automated Project Management in Google Sheets Automate Row Deletion in Google Sheets with Apps Script When Urgent, Move to Top of Google Sheet Move Row Based on Dropdown

the oned can be any kind of variable. You can have the whole event here, uh, as a name. You just have to change everything to event, event here, and we can also change it here Event. There we go. Hope you enjoyed that. Stick around. Subscribe today and get more automations here on YouTube on better sheets. Different Kinds of Automation Automation is not Magic