Here is what I have so far. it will:
- Search for keyword in my other sheet (JSON)
- When it finds the keyword (modname) it returns the row #
The keyword is on the A column. What I want is for a function to return the value on the B column of the same row. How do I do this?
function onSearch2(modname)
{
var searchString = modname;
var sheet = SpreadsheetApp.getActiveSpreadsheet().getSheetByName("JSON164");
var column =1; //column Index
var columnValues = sheet.getRange(2, column, sheet.getLastRow()).getValues(); //1st is header row
var searchResult = columnValues.findIndex(searchString); //Row Index - 2
if(searchResult != -1)
{
//searchResult + 2 is row index.
SpreadsheetApp.getActiveSpreadsheet().setActiveRange(sheet.getRange(searchResult + 2, 1))
return searchResult+2
}
}