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

Closed
Nvcworld - Updated on Jul 5, 2018 at 05:23 AM
 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


Related:

2 responses

Blocked Profile
Jul 5, 2018 at 10:42 AM
You have to write them in GOOGLE APPS SCRIPTS! Have FUN!
0
Yes , but being a mech engg i dont have knowedge of it and struglrd a lot , thats why i did this post
0
Blocked Profile
Jul 5, 2018 at 12:57 PM
No. We don't provide turn key solutions! If you need it for work, then let the organization pay for Professional services. I am not going to volunteer my time, to make your company money! If you were stuck on the code, I would help. I don't do complete solutions for FREE!
0
Nvcworld > Blocked Profile
Jul 6, 2018 at 08:53 AM
Thanks master for your reply, I do not have any company, this code just for personal level.
Inspired by you , somehow i have done this code

function given() {
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('Tabledata');
t.clearContents();
t.getRange(1,1,arr.length,arr[0].length).setValues(arr);
};

This is finding "Table" text in column A and copying respective row , after this step it's going to sheet name "Tabledata" and clean it and pasting .

I have played a lot of code and searched a lot on net but really not getting any solution, hence I am asking help of masters as like you .

I want to do is.

1) It should find Table name in column D instead of column A

2) after copy it should paste in next empty row


Thanks & regards
0
Blocked Profile
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.
0
Nvcworld > Blocked Profile
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
0
Blocked Profile
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!
0