Move All Checked Rows

preview_player
Показать описание
How to move all checked rows to another tab.
Important notes:
* Keep your math correct when iterating through the data array, deleting items from the Sheet, and deleting items from the array

Sheet (to copy from File then "Make a copy")

Script:
function moveChecked(){

let out = [];
if (data[i][2] == true){
i--;
}
}
}

Connect with me:
• Twitter @FarrisSpencer
Рекомендации по теме
Комментарии
Автор

your channel is really underrated. keep grinding man. it's very helpful.

bocobox
Автор

Hi Spencer sad to hear no more videos for foreseeable. Having an issue with line 7 of this code. let out = []; when I log(out) the info reads blank? I’ve even used the same columns as your video to see if this fixes but no luck :/

joshwilliams
Автор

What should i be learning prior to this ? I am lost but am eager to learn google sheets to streamline tasks within my company. Please help! THe videos I find are either extemely basic OR far beyond my coprehension.

MeganStevenson-lkpf
Автор

Thank you for tbis video. You're such a great help. Just 1 question, my check box is in column 1, i want to move entire row but not included the check box to the destination.. How to do it? Thank you in advance.

erwinquejada
Автор

I have a specific question how I can contact you I contact you ?

samer_Alkhafaji
Автор

Damn, im learning so much from you it's insane but im still struggling... I'm working on a sheet basically, a task sheet with archive the goal is to make it when column I ( has checkboxes ) gets "true" it creates date stamp in column K and the next action is to move row that has been marked by that check box to archive. I was able to make a date stamp but it won't move row. Could you enlighten me a bit :"3

michaprolejko
Автор

It worked great. I'm going to use it in a timed trigger daily. I'm pretty new to this I'm sure I need to add an "else" statement in case there are no items checked at the time the function is ran(otherwise I'll get error code). I've tried adding it to your function but I'm not sure where and how the else function should be placed. Here is my code:

function MoveLube(){
const sh = SpreadsheetApp.getActive();
const ss = sh.getSheetByName("Lube");
const outSheet =

let data = ss.getRange(11, 1, ss.getLastRow()-1, 17).getValues();
let out = [];
for (let i = 0; i < data.length; i++){
if(data[i][16] == true){;
out.push(data[i]);
ss.deleteRow(i+11);
data.splice(i, 1);
i--;
}
}
outSheet.getRange(outSheet.getLastRow()+1, 1, out.length, 17).setValues(out);

}

AlGray-gh
Автор

Would there be a way to pull from multiple sheets and organize them into one?

thedesignbuildexperience
Автор

Sir please, How to move from master sheet or from query function

cimalshankar
Автор

It really worked in one of my sheet but when I tried it in another file, I get this error:
"Exception: The number of rows in the range must be at least 1"
This error is from outSheet.getRange(outSheet.getLastRow()+1, 1, out.length, 3).setValues(out);

I don't know what's wrong. Any ideas?

evernestsupport
Автор

First of all your channel is awesome! And, would you be so kind and could you help me and check this bit for me? What if we have more columns in the spreadsheet (let's say 10), is my code correct?

let data = sourceSheet.getRange(2, 1, spreadSheet.getLastRow()-1, 10).getValues();

let out = [ ];
for (let i = 0; i < data.length; i++){
if(data[i][10] == true){
out.push(data[i]);
}
}

tomekgut