Quantcast
Channel: Hot Weekly Questions - Web Applications Stack Exchange
Viewing all articles
Browse latest Browse all 9843

Trying to search(from sheet1 ) for a value on in any row of sheet2

$
0
0

I have 2 sheets "Main" and "Data Storage"

Main: should allow me to search "Data Storage" and locate information form any column(let say Column B') and provide me with information within the entire row belonging to column "B" which has been successful...somewhat, i used "Jane dowe" and was able to get information, but when i tried using other data within the row the script ran but came up blank

issue: I need to be able to use any veritable of column B' to locate information with in the row

What I have so far is :

var SPREADSHEET_NAME = "Data Storage";var SEARCH_COL_IDX = 1;var RETURN_COL_IDX = 0;function searchStr() {  var ss        = SpreadsheetApp.getActiveSpreadsheet();  var formSS    = ss.getSheetByName("Main"); //Form Sheet  var str       = formSS.getRange("I20").getValue();  for (var i = 16; i < values.length; i++) {    var row = values[i];    if (row[SEARCH_COL_IDX] == str) {      formSS.getRange("G3").setValue(row[0]) ;      formSS.getRange("C5").setValue(row[1]);      formSS.getRange("C3").setValue(row[2]);      formSS.getRange("C7").setValue(row[3]);      formSS.getRange("E7").setValue(row[4]);      formSS.getRange("G7").setValue(row[5]);      formSS.getRange("C9").setValue(row[6]);      formSS.getRange("E9").setValue(row[7]);      formSS.getRange("G9").setValue(row[8]);      formSS.getRange("C11").setValue(row[9]);      formSS.getRange("E11").setValue(row[10]);      formSS.getRange("G11").setValue(row[11]);      formSS.getRange("I10").setValue(row[12]);      formSS.getRange("I5").setValue(row[13]);      formSS.getRange("I16").setValue(row[14]);      formSS.getRange("B18").setValue(row[15]);      return row[RETURN_COL_IDX];    }  }}

example of sheet 1 "Main"

example of sheet 2 "Data Storage"


Viewing all articles
Browse latest Browse all 9843

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>