前提
GAS
内容
forループを入れ子にして、縦横方向に探索しました。
function searchKeyword() {
const UI = SpreadsheetApp.getUi();
const ThisSpread = SpreadsheetApp.getActiveSpreadsheet();
const BeSearchedSheet = ThisSpread.getSheetByName('sheet5');
for (let vertical = 1; vertical<=3; vertical++){
for(let horizontal = 1; horizontal <= 3; horizontal++){
let search_node = BeSearchedSheet.getRange(vertical, horizontal).getValue();
if(search_node.match('here!')){
UI.alert('i did it ! => ' + 'vertical:' + vertical + 'horizontal:' + horizontal);
break;
}
}
}
}