Move Row Based on Dropdown

Learn how to effectively manage tasks in Google Sheets by moving entire rows based on dropdown selections, creating a simple CRM or task list with different priority tabs.

We're trying to use our Google sheet as a very simple CRM or even as a task list here with different priorities. Maybe we have dozens, but sometimes we may have hundreds of tasks or CRM things, and we have these priorities and we don't want all of the priorities on one sheet. We actually want to be able to go low and then maybe duplicate this. And call it urgent. And we don't want everything here. We want just the urgent ones there, right? And we just want low there and we want these at separate taps. So how do we move the whole row based on what the dropdown is? I'm gonna show you that in this video. We're gonna go up to extensions app script . Just a little bit more setup is, I want to take a blank. One and duplicate this and call it medium, and then one more and call it high.

Now, we have all of our existing tasks here, but we have three other , tabs that based on the priority, they should go to that particular tab. All right, we're gonna create a function called oned. Now on edit is a built-in function . It has lots of cool stuff. We're gonna create an event here, and this event variable is gonna have some really awesome data in it. Meaning we know what sheet we're on, we know what row we're on, what column we're on. So we can say cons, row equals event dot range . Do GI Row. We know what column we're on. Event range . Get. Column, the sheet we're on is actually spreadsheet app do get active sheet , and so if the column we're on is equal to two, meaning the column is the

priority column, and row is greater than one, we're not editing the header . We want to move. That whole row to the proper sheet. So we actually know one more thing, which is the value or the priority, in this case, E value. So when we're editing a dropdown , we're actually editing the seller, changing the cell to another text that's gonna be here in this E value. And the sheet GI sheet name is not equal to the priority. Then we want to move the row. Well, which row? Let's get the row. Data equals sheet get range in the current row.

One one, which is the number of the first column, and now the number of rows and then the number of columns is gonna be sheet do get last column. And then outside of this, we'll say, get values . And then we need to know where we're going to. Target sheet is equal to spreadsheet app. Do get active spreadsheet , get sheet by name, and the name is going to be the priority. So target sheet, do append row and the row is going to be the row data . Now let's see if this works as is. So we're gonna change this low one to urgent. So it's update social media calendar. I think it's gonna be. We failed because E is not defined in code five.

I think just a change in E to event. Yeah, E to event. Sometimes I do E just to make it super simple and fast instead of five characters of event. Alright, let's try that again. Actually delete that and go urgent. And there it is. I think we need to add this here. Let's try that again. Let's do it with this one. Run QA tests and there it's run QA tests and we have urgent, and if we have medium, medium research competitors, there it is. So now the last thing we need to do is delete. The row where we're coming from. So we're on the sheet, we're on delete row , and we're gonna delete the row. So how we're moving it is we're appending the data to another sheet, and

then we're deleting the row we're on. So now just to medium. And that deletes, and it's here on medium, but if we change it to low, let's say it'll go back here, send invoices, let's change this to low, and it's on the right sheet. Urgent. And it moves. Perfect., Does not allow us to copy paste, but actually click and edit the text. And there you go. We are now moving the row based on dropdown two. It's intended tab. Hope you enjoyed that. Hope it's helpful to are watching better sheets here on YouTube. Make sure you check out this video or this video and subscribe right now to get more tips, tricks, how tos, get more out of your Google sheets than you ever have before. I'm excited to be making a ton more videos here.

Ask me questions down in the comments and I will answer them in future videos. But for right now, right here, one of these videos is gonna be your next Google sheet.