Find in column and Copy it's row code for Google s

Nvcworld - Jul 5, 2018 at 02:11 AM - Latest reply:  Nvcworld
- Jul 7, 2018 at 11:51 AM
Hello,
I have created code in MS Excel for finding particular text in column and after finding text the entire row should be copy and add in next sheet after the Last entry but this code is not working for Google sheets.

can you please help me to create same code for Google sheets thanks in advance


See more 

Your reply

9 replies

ac3mark 10525 Posts Monday June 3, 2013Registration dateModeratorStatus September 21, 2018 Last seen - Jul 5, 2018 at 10:42 AM
0
Thank you
You have to write them in GOOGLE APPS SCRIPTS! Have FUN!
Respond to ac3mark
0
Thank you
Yes , but being a mech engg i dont have knowedge of it and struglrd a lot , thats why i did this post
ac3mark 10525 Posts Monday June 3, 2013Registration dateModeratorStatus September 21, 2018 Last seen - Jul 6, 2018 at 10:39 AM
OK, lets look at this line:

if(v[i][0]==='Table') {


"[0]" is the Column, I believe. Arrays start at 0, so 0=a,1=b,2=c,3=d. I have not verified this, I am only looking at code and not referencing any documentation from Google. Test that and if that is the case, we will move on the second one.
Nvcworld > ac3mark 10525 Posts Monday June 3, 2013Registration dateModeratorStatus September 21, 2018 Last seen - Jul 6, 2018 at 12:00 PM
Hi master,

Yours suggestions is right, now it's changing column ...... Now I am playing with code for next level .
Your few lines pushed me few steps ahead.

Once again thanks
ac3mark 10525 Posts Monday June 3, 2013Registration dateModeratorStatus September 21, 2018 Last seen - Jul 6, 2018 at 12:52 PM
Post back if you get stuck. It makes me happy to know that I am just assisting with the help, and you are actually learning. Not just "cut and paste" like most here!
Nvcworld > ac3mark 10525 Posts Monday June 3, 2013Registration dateModeratorStatus September 21, 2018 Last seen - Jul 7, 2018 at 03:22 AM
Sir,
As per your guidance I played a lot to add copy row to add in next empty row but not getting success ... Even I tried to add 1 more item like pencil and pencil inventory sheet ..but not working...
Can you please guide me for same ?

Thanks & regards
Nvcworld > Nvcworld - Jul 7, 2018 at 11:51 AM
Hi master,
I played full day to paste data in next row but failed .

This is my book ,

https://docs.google.com/spreadsheets/d/14t6QkiZ1CgBw22AnkSklq5TzwBkcq0Nje5hsMmcS-Ms/edit#gid=1207972376

its realy very hard for me , need yours guidens ,please and this is code


function xpc() {
var ss = SpreadsheetApp.getActiveSpreadsheet();
var s = ss.getSheetByName('Sheet1');
var r = s.getDataRange();
var v = r.getValues();
var arr = new Array();
for(var i=0;i<v.length;i++) {
if(v[i][0]==='Table') {
arr.push(v[i]);
}
}

var t = ss.getSheetByName('Table');
t.getRange((t.getLastRow(),+1),1,arr.length,arr[0].length).setValues(arr);


//var ss = SpreadsheetApp.getActiveSpreadsheet();
// var s = ss.getSheetByName('Sheet1');
//var source = s.getRange('A:A');
// var destSheet = ss.getSheetByName('table');
// var destRange = destSheet.getRange(destSheet.getLastRow()+1,1);
//source.copyTo (destRange, {contentsOnly: true});

};
Respond to Nvcworld